diff --git a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template index 331872e1265..a757aad396d 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -64,7 +64,8 @@ then "${RELEASE_IMAGE_DIGEST}" \ render \ --output-dir=/assets/cvo-bootstrap \ - --release-image="${RELEASE_IMAGE_DIGEST}" + --release-image="${RELEASE_IMAGE_DIGEST}" \ + --cluster-profile={{.ClusterProfile}} cp cvo-bootstrap/bootstrap/* bootstrap-manifests/ cp cvo-bootstrap/manifests/* manifests/ diff --git a/data/data/install.openshift.io_installconfigs.yaml b/data/data/install.openshift.io_installconfigs.yaml index b036078574a..034467895d1 100644 --- a/data/data/install.openshift.io_installconfigs.yaml +++ b/data/data/install.openshift.io_installconfigs.yaml @@ -34,6 +34,10 @@ spec: description: BaseDomain is the base domain to which the cluster should belong. type: string + clusterProfile: + default: default + description: ClusterProfile is used to select the deployment model + type: string compute: description: Compute is the configuration for the machines that comprise the compute nodes. diff --git a/pkg/asset/ignition/bootstrap/bootstrap.go b/pkg/asset/ignition/bootstrap/bootstrap.go index 9ca1856f03f..f1f02b21f5d 100644 --- a/pkg/asset/ignition/bootstrap/bootstrap.go +++ b/pkg/asset/ignition/bootstrap/bootstrap.go @@ -55,6 +55,7 @@ type bootstrapTemplateData struct { BootImage string ClusterDomain string PlatformData platformTemplateData + ClusterProfile string } // platformTemplateData is the data to use to replace values in bootstrap @@ -261,6 +262,7 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI BootImage: string(*rhcosImage), ClusterDomain: installConfig.ClusterDomain(), PlatformData: platformData, + ClusterProfile: installConfig.ClusterProfile, }, nil } diff --git a/pkg/types/defaults/installconfig.go b/pkg/types/defaults/installconfig.go index 3d003ee9ee8..62fa053dca0 100644 --- a/pkg/types/defaults/installconfig.go +++ b/pkg/types/defaults/installconfig.go @@ -20,6 +20,7 @@ var ( defaultClusterNetwork = ipnet.MustParseCIDR("10.128.0.0/14") defaultHostPrefix = 23 defaultNetworkType = "OpenShiftSDN" + defaultClusterProfile = "default" ) // SetInstallConfigDefaults sets the defaults for the install config. @@ -87,4 +88,7 @@ func SetInstallConfigDefaults(c *types.InstallConfig) { case c.Platform.None != nil: nonedefaults.SetPlatformDefaults(c.Platform.None) } + if c.ClusterProfile == "" { + c.ClusterProfile = defaultClusterProfile + } } diff --git a/pkg/types/installconfig.go b/pkg/types/installconfig.go index 5f6f4c085a1..c7ce6b3d178 100644 --- a/pkg/types/installconfig.go +++ b/pkg/types/installconfig.go @@ -138,6 +138,12 @@ type InstallConfig struct { // GCP: "mint", "passthrough" // +optional CredentialsMode CredentialsMode `json:"credentialsMode,omitempty"` + + // ClusterProfile is used to select the deployment model + // + // +kubebuilder:default=default + // +optional + ClusterProfile string `json:"clusterProfile,omitempty"` } // ClusterDomain returns the DNS domain that all records for a cluster must belong to.