diff --git a/bootstrap/api/v1beta2/kthreesconfig_types.go b/bootstrap/api/v1beta2/kthreesconfig_types.go index e622757e..3611d660 100644 --- a/bootstrap/api/v1beta2/kthreesconfig_types.go +++ b/bootstrap/api/v1beta2/kthreesconfig_types.go @@ -120,6 +120,10 @@ type KThreesServerConfig struct { // CloudProviderName defines the --cloud-provider= kubelet extra arg. (default: "external") // +optional CloudProviderName *string `json:"cloudProviderName,omitempty"` + + // SystemDefaultRegistry defines private registry to be used for all system images + // +optional + SystemDefaultRegistry string `json:"systemDefaultRegistry,omitempty"` } type KThreesAgentConfig struct { diff --git a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml index febbf886..05e5781f 100644 --- a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml +++ b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml @@ -496,6 +496,10 @@ spec: description: 'ServiceCidr Network CIDR to use for services IPs (default: "10.43.0.0/16")' type: string + systemDefaultRegistry: + description: SystemDefaultRegistry defines private registry to + be used for all system images + type: string tlsSan: description: TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert diff --git a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml index bea8c859..90a3b64a 100644 --- a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml +++ b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml @@ -458,6 +458,10 @@ spec: description: 'ServiceCidr Network CIDR to use for services IPs (default: "10.43.0.0/16")' type: string + systemDefaultRegistry: + description: SystemDefaultRegistry defines private registry + to be used for all system images + type: string tlsSan: description: TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert diff --git a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml index 42a40faa..1b8e8dc9 100644 --- a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml +++ b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml @@ -804,6 +804,10 @@ spec: description: 'ServiceCidr Network CIDR to use for services IPs (default: "10.43.0.0/16")' type: string + systemDefaultRegistry: + description: SystemDefaultRegistry defines private registry + to be used for all system images + type: string tlsSan: description: TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert diff --git a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml index c7d09398..b9c3529e 100644 --- a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml +++ b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml @@ -244,6 +244,10 @@ spec: description: 'ServiceCidr Network CIDR to use for services IPs (default: "10.43.0.0/16")' type: string + systemDefaultRegistry: + description: SystemDefaultRegistry defines private + registry to be used for all system images + type: string tlsSan: description: TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert diff --git a/pkg/k3s/config.go b/pkg/k3s/config.go index d2cdb141..c81d816d 100644 --- a/pkg/k3s/config.go +++ b/pkg/k3s/config.go @@ -25,6 +25,7 @@ type K3sServerConfig struct { ClusterDomain string `json:"cluster-domain,omitempty"` DisableComponents []string `json:"disable,omitempty"` ClusterInit bool `json:"cluster-init,omitempty"` + SystemDefaultRegistry string `json:"system-default-registry,omitempty"` K3sAgentConfig `json:",inline"` } @@ -57,6 +58,7 @@ func GenerateInitControlPlaneConfig(controlPlaneEndpoint string, token string, s ClusterDNS: serverConfig.ClusterDNS, ClusterDomain: serverConfig.ClusterDomain, DisableComponents: serverConfig.DisableComponents, + SystemDefaultRegistry: serverConfig.SystemDefaultRegistry, } k3sServerConfig.K3sAgentConfig = K3sAgentConfig{ @@ -89,6 +91,7 @@ func GenerateJoinControlPlaneConfig(serverURL string, token string, controlplane ClusterDNS: serverConfig.ClusterDNS, ClusterDomain: serverConfig.ClusterDomain, DisableComponents: serverConfig.DisableComponents, + SystemDefaultRegistry: serverConfig.SystemDefaultRegistry, } k3sServerConfig.K3sAgentConfig = K3sAgentConfig{