Skip to content

Commit 66e4a92

Browse files
authored
feat: add dnsServiceIPs field to network settings (#206)
Signed-off-by: Mario Valderrama <[email protected]>
1 parent c30ba90 commit 66e4a92

6 files changed

+43
-0
lines changed

api/v1alpha1/kamajicontrolplane_types.go

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ type NetworkComponent struct {
8181
// Configure additional Subject Address Names for the kube-apiserver certificate,
8282
// useful if the TenantControlPlane is going to be exposed behind a FQDN with NAT.
8383
CertSANs []string `json:"certSANs,omitempty"` //nolint:tagliatelle
84+
// DNSServiceIPs contains the DNS Service IPs.
85+
// If the CoreDNS addon is specified, its DNSServiceIPs will be used instead.
86+
// When set to an empty slice, Kamaji will automatically inflect it from the Service CIDR.
87+
DNSServiceIPs []string `json:"dnsServiceIPs,omitempty"`
8488
}
8589

8690
// AddonsSpec defines the enabled addons and their features.

api/v1alpha1/zz_generated.deepcopy.go

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

config/control-plane-components.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -6370,6 +6370,14 @@ spec:
63706370
items:
63716371
type: string
63726372
type: array
6373+
dnsServiceIPs:
6374+
description: |-
6375+
DNSServiceIPs contains the DNS Service IPs.
6376+
If the CoreDNS addon is specified, its DNSServiceIPs will be used instead.
6377+
When set to an empty slice, Kamaji will automatically inflect it from the Service CIDR.
6378+
items:
6379+
type: string
6380+
type: array
63736381
ingress:
63746382
description: |-
63756383
When specified, the KamajiControlPlane will be reachable using an Ingress object
@@ -13082,6 +13090,14 @@ spec:
1308213090
items:
1308313091
type: string
1308413092
type: array
13093+
dnsServiceIPs:
13094+
description: |-
13095+
DNSServiceIPs contains the DNS Service IPs.
13096+
If the CoreDNS addon is specified, its DNSServiceIPs will be used instead.
13097+
When set to an empty slice, Kamaji will automatically inflect it from the Service CIDR.
13098+
items:
13099+
type: string
13100+
type: array
1308513101
ingress:
1308613102
description: |-
1308713103
When specified, the KamajiControlPlane will be reachable using an Ingress object

config/crd/bases/controlplane.cluster.x-k8s.io_kamajicontrolplanes.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -6652,6 +6652,14 @@ spec:
66526652
items:
66536653
type: string
66546654
type: array
6655+
dnsServiceIPs:
6656+
description: |-
6657+
DNSServiceIPs contains the DNS Service IPs.
6658+
If the CoreDNS addon is specified, its DNSServiceIPs will be used instead.
6659+
When set to an empty slice, Kamaji will automatically inflect it from the Service CIDR.
6660+
items:
6661+
type: string
6662+
type: array
66556663
ingress:
66566664
description: |-
66576665
When specified, the KamajiControlPlane will be reachable using an Ingress object

config/crd/bases/controlplane.cluster.x-k8s.io_kamajicontrolplanetemplates.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -6731,6 +6731,14 @@ spec:
67316731
items:
67326732
type: string
67336733
type: array
6734+
dnsServiceIPs:
6735+
description: |-
6736+
DNSServiceIPs contains the DNS Service IPs.
6737+
If the CoreDNS addon is specified, its DNSServiceIPs will be used instead.
6738+
When set to an empty slice, Kamaji will automatically inflect it from the Service CIDR.
6739+
items:
6740+
type: string
6741+
type: array
67346742
ingress:
67356743
description: |-
67366744
When specified, the KamajiControlPlane will be reachable using an Ingress object

controllers/kamajicontrolplane_controller_tcp.go

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ func (r *KamajiControlPlaneReconciler) createOrUpdateTenantControlPlane(ctx cont
8787
} else {
8888
tcp.Spec.Kubernetes.Version = kcp.Spec.Version
8989
}
90+
// Set before CoreDNS addon to allow override.
91+
tcp.Spec.NetworkProfile.DNSServiceIPs = kcp.Spec.Network.DNSServiceIPs
9092
// Kamaji addons and CoreDNS overrides
9193
tcp.Spec.Addons = kcp.Spec.Addons.AddonsSpec
9294
if kcp.Spec.Addons.CoreDNS != nil {

0 commit comments

Comments
 (0)