Skip to content

Commit 0ecdf6a

Browse files
committed
HOSTEDCP-1960: Add KubeAPIExteralName api
This new API changes the value of the Kubeconfig External URL to points to your desired one Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
1 parent 7c9455f commit 0ecdf6a

38 files changed

+943
-11
lines changed

Diff for: api/hypershift/v1beta1/hosted_controlplane.go

+17
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ type HostedControlPlaneSpec struct {
115115
// +optional
116116
KubeConfig *KubeconfigSecretRef `json:"kubeconfig,omitempty"`
117117

118+
// CustomKubeConfig specifies the name and key for the External Custom kubeconfig secret
119+
// +optional
120+
CustomKubeConfig *KubeconfigSecretRef `json:"customKubeConfig,omitempty"`
121+
122+
// kubeApiExternalName specifies the external name for the Kube API Server service.
123+
// This is used to configure the Kube API Server service to use a different name, so
124+
// the DNS should be configured to resolve the external name to the Kube API Server service.
125+
// +kubebuilder:validation:MaxLength=100
126+
// +kubebuilder:validation:MinLength=1
127+
// +kubebuilder:example: "api.example.com"
128+
// +optional
129+
KubeAPIExternalName string `json:"kubeApiExternalName,omitempty"`
130+
118131
// Services defines metadata about how control plane services are published
119132
// in the management cluster.
120133
// +kubebuilder:validation:MaxItems=6
@@ -300,6 +313,10 @@ type HostedControlPlaneStatus struct {
300313
// for this control plane.
301314
KubeConfig *KubeconfigSecretRef `json:"kubeConfig,omitempty"`
302315

316+
// CustomKubeConfig specifies the name and key for the External Custom kubeconfig secret
317+
// +optional
318+
CustomKubeConfig *KubeconfigSecretRef `json:"customKubeConfig,omitempty"`
319+
303320
// KubeadminPassword is a reference to the secret containing the initial kubeadmin password
304321
// for the guest cluster.
305322
// +optional

Diff for: api/hypershift/v1beta1/hostedcluster_types.go

+11
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@ type HostedClusterSpec struct {
432432
// +required
433433
Platform PlatformSpec `json:"platform"`
434434

435+
// kubeApiExternalName specifies the external name for the Kube API Server service.
436+
// +kubebuilder:validation:MaxLength=100
437+
// +kubebuilder:validation:MinLength=1
438+
// +kubebuilder:example: "api.example.com"
439+
// +optional
440+
KubeAPIExternalName string `json:"kubeApiExternalName,omitempty"`
441+
435442
// controllerAvailabilityPolicy specifies the availability policy applied to critical control plane components like the Kube API Server.
436443
// Possible values are HighlyAvailable and SingleReplica. The default value is HighlyAvailable.
437444
// +optional
@@ -1423,6 +1430,10 @@ type HostedClusterStatus struct {
14231430
// +optional
14241431
KubeConfig *corev1.LocalObjectReference `json:"kubeconfig,omitempty"`
14251432

1433+
// CustomKubeConfig specifies the name and key for the External Custom kubeconfig secret
1434+
// +optional
1435+
CustomKubeConfig *corev1.LocalObjectReference `json:"customKubeConfig,omitempty"`
1436+
14261437
// KubeadminPassword is a reference to the secret that contains the initial
14271438
// kubeadmin user password for the guest cluster.
14281439
// +optional

Diff for: api/hypershift/v1beta1/zz_generated.deepcopy.go

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,12 @@ spec:
23472347
rule: self == oldSelf
23482348
- message: issuerURL must be a valid absolute URL
23492349
rule: isURL(self)
2350+
kubeApiExternalName:
2351+
description: kubeApiExternalName specifies the external name for the
2352+
Kube API Server service.
2353+
maxLength: 100
2354+
minLength: 1
2355+
type: string
23502356
networking:
23512357
default:
23522358
clusterNetwork:
@@ -4170,6 +4176,21 @@ spec:
41704176
- host
41714177
- port
41724178
type: object
4179+
customKubeConfig:
4180+
description: CustomKubeConfig specifies the name and key for the External
4181+
Custom kubeconfig secret
4182+
properties:
4183+
name:
4184+
default: ""
4185+
description: |-
4186+
Name of the referent.
4187+
This field is effectively required, but due to backwards compatibility is
4188+
allowed to be empty. Instances of this type with an empty value here are
4189+
almost certainly wrong.
4190+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4191+
type: string
4192+
type: object
4193+
x-kubernetes-map-type: atomic
41734194
ignitionEndpoint:
41744195
description: |-
41754196
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AROHCPManagedIdentities.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,12 @@ spec:
23432343
rule: self == oldSelf
23442344
- message: issuerURL must be a valid absolute URL
23452345
rule: isURL(self)
2346+
kubeApiExternalName:
2347+
description: kubeApiExternalName specifies the external name for the
2348+
Kube API Server service.
2349+
maxLength: 100
2350+
minLength: 1
2351+
type: string
23462352
networking:
23472353
default:
23482354
clusterNetwork:
@@ -4415,6 +4421,21 @@ spec:
44154421
- host
44164422
- port
44174423
type: object
4424+
customKubeConfig:
4425+
description: CustomKubeConfig specifies the name and key for the External
4426+
Custom kubeconfig secret
4427+
properties:
4428+
name:
4429+
default: ""
4430+
description: |-
4431+
Name of the referent.
4432+
This field is effectively required, but due to backwards compatibility is
4433+
allowed to be empty. Instances of this type with an empty value here are
4434+
almost certainly wrong.
4435+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4436+
type: string
4437+
type: object
4438+
x-kubernetes-map-type: atomic
44184439
ignitionEndpoint:
44194440
description: |-
44204441
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,12 @@ spec:
23882388
rule: self == oldSelf
23892389
- message: issuerURL must be a valid absolute URL
23902390
rule: isURL(self)
2391+
kubeApiExternalName:
2392+
description: kubeApiExternalName specifies the external name for the
2393+
Kube API Server service.
2394+
maxLength: 100
2395+
minLength: 1
2396+
type: string
23912397
networking:
23922398
default:
23932399
clusterNetwork:
@@ -4203,6 +4209,21 @@ spec:
42034209
- host
42044210
- port
42054211
type: object
4212+
customKubeConfig:
4213+
description: CustomKubeConfig specifies the name and key for the External
4214+
Custom kubeconfig secret
4215+
properties:
4216+
name:
4217+
default: ""
4218+
description: |-
4219+
Name of the referent.
4220+
This field is effectively required, but due to backwards compatibility is
4221+
allowed to be empty. Instances of this type with an empty value here are
4222+
almost certainly wrong.
4223+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4224+
type: string
4225+
type: object
4226+
x-kubernetes-map-type: atomic
42064227
ignitionEndpoint:
42074228
description: |-
42084229
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/DynamicResourceAllocation.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,12 @@ spec:
23642364
rule: self == oldSelf
23652365
- message: issuerURL must be a valid absolute URL
23662366
rule: isURL(self)
2367+
kubeApiExternalName:
2368+
description: kubeApiExternalName specifies the external name for the
2369+
Kube API Server service.
2370+
maxLength: 100
2371+
minLength: 1
2372+
type: string
23672373
networking:
23682374
default:
23692375
clusterNetwork:
@@ -4179,6 +4185,21 @@ spec:
41794185
- host
41804186
- port
41814187
type: object
4188+
customKubeConfig:
4189+
description: CustomKubeConfig specifies the name and key for the External
4190+
Custom kubeconfig secret
4191+
properties:
4192+
name:
4193+
default: ""
4194+
description: |-
4195+
Name of the referent.
4196+
This field is effectively required, but due to backwards compatibility is
4197+
allowed to be empty. Instances of this type with an empty value here are
4198+
almost certainly wrong.
4199+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4200+
type: string
4201+
type: object
4202+
x-kubernetes-map-type: atomic
41824203
ignitionEndpoint:
41834204
description: |-
41844205
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,12 @@ spec:
25852585
rule: self == oldSelf
25862586
- message: issuerURL must be a valid absolute URL
25872587
rule: isURL(self)
2588+
kubeApiExternalName:
2589+
description: kubeApiExternalName specifies the external name for the
2590+
Kube API Server service.
2591+
maxLength: 100
2592+
minLength: 1
2593+
type: string
25882594
networking:
25892595
default:
25902596
clusterNetwork:
@@ -4400,6 +4406,21 @@ spec:
44004406
- host
44014407
- port
44024408
type: object
4409+
customKubeConfig:
4410+
description: CustomKubeConfig specifies the name and key for the External
4411+
Custom kubeconfig secret
4412+
properties:
4413+
name:
4414+
default: ""
4415+
description: |-
4416+
Name of the referent.
4417+
This field is effectively required, but due to backwards compatibility is
4418+
allowed to be empty. Instances of this type with an empty value here are
4419+
almost certainly wrong.
4420+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4421+
type: string
4422+
type: object
4423+
x-kubernetes-map-type: atomic
44034424
ignitionEndpoint:
44044425
description: |-
44054426
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPPodsLabels.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,12 @@ spec:
23432343
rule: self == oldSelf
23442344
- message: issuerURL must be a valid absolute URL
23452345
rule: isURL(self)
2346+
kubeApiExternalName:
2347+
description: kubeApiExternalName specifies the external name for the
2348+
Kube API Server service.
2349+
maxLength: 100
2350+
minLength: 1
2351+
type: string
23462352
labels:
23472353
additionalProperties:
23482354
type: string
@@ -4171,6 +4177,21 @@ spec:
41714177
- host
41724178
- port
41734179
type: object
4180+
customKubeConfig:
4181+
description: CustomKubeConfig specifies the name and key for the External
4182+
Custom kubeconfig secret
4183+
properties:
4184+
name:
4185+
default: ""
4186+
description: |-
4187+
Name of the referent.
4188+
This field is effectively required, but due to backwards compatibility is
4189+
allowed to be empty. Instances of this type with an empty value here are
4190+
almost certainly wrong.
4191+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4192+
type: string
4193+
type: object
4194+
x-kubernetes-map-type: atomic
41744195
ignitionEndpoint:
41754196
description: |-
41764197
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/NetworkDiagnosticsConfig.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,12 @@ spec:
24952495
rule: self == oldSelf
24962496
- message: issuerURL must be a valid absolute URL
24972497
rule: isURL(self)
2498+
kubeApiExternalName:
2499+
description: kubeApiExternalName specifies the external name for the
2500+
Kube API Server service.
2501+
maxLength: 100
2502+
minLength: 1
2503+
type: string
24982504
networking:
24992505
default:
25002506
clusterNetwork:
@@ -4310,6 +4316,21 @@ spec:
43104316
- host
43114317
- port
43124318
type: object
4319+
customKubeConfig:
4320+
description: CustomKubeConfig specifies the name and key for the External
4321+
Custom kubeconfig secret
4322+
properties:
4323+
name:
4324+
default: ""
4325+
description: |-
4326+
Name of the referent.
4327+
This field is effectively required, but due to backwards compatibility is
4328+
allowed to be empty. Instances of this type with an empty value here are
4329+
almost certainly wrong.
4330+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4331+
type: string
4332+
type: object
4333+
x-kubernetes-map-type: atomic
43134334
ignitionEndpoint:
43144335
description: |-
43154336
IgnitionEndpoint is the endpoint injected in the ign config userdata.

Diff for: api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,12 @@ spec:
23432343
rule: self == oldSelf
23442344
- message: issuerURL must be a valid absolute URL
23452345
rule: isURL(self)
2346+
kubeApiExternalName:
2347+
description: kubeApiExternalName specifies the external name for the
2348+
Kube API Server service.
2349+
maxLength: 100
2350+
minLength: 1
2351+
type: string
23462352
networking:
23472353
default:
23482354
clusterNetwork:
@@ -4646,6 +4652,21 @@ spec:
46464652
- host
46474653
- port
46484654
type: object
4655+
customKubeConfig:
4656+
description: CustomKubeConfig specifies the name and key for the External
4657+
Custom kubeconfig secret
4658+
properties:
4659+
name:
4660+
default: ""
4661+
description: |-
4662+
Name of the referent.
4663+
This field is effectively required, but due to backwards compatibility is
4664+
allowed to be empty. Instances of this type with an empty value here are
4665+
almost certainly wrong.
4666+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4667+
type: string
4668+
type: object
4669+
x-kubernetes-map-type: atomic
46494670
ignitionEndpoint:
46504671
description: |-
46514672
IgnitionEndpoint is the endpoint injected in the ign config userdata.

0 commit comments

Comments
 (0)