diff --git a/api/v1alpha1/addon_types.go b/api/v1alpha1/addon_types.go index c116c0992..9263eb678 100644 --- a/api/v1alpha1/addon_types.go +++ b/api/v1alpha1/addon_types.go @@ -96,6 +96,8 @@ type GenericAddons struct { ServiceLoadBalancer *ServiceLoadBalancer `json:"serviceLoadBalancer,omitempty"` } +// +kubebuilder:validation:Required +// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon type AddonStrategy string // CNI required for providing CNI configuration. @@ -104,17 +106,16 @@ type CNI struct { // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=Calico;Cilium Provider string `json:"provider"` + // Addon strategy used to deploy the CNI provider to the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` } // NFD tells us to enable or disable the node feature discovery addon. type NFD struct { // Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` } @@ -122,8 +123,7 @@ type NFD struct { type ClusterAutoscaler struct { // Addon strategy used to deploy cluster-autoscaler to the management cluster // targeting the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` } @@ -138,8 +138,7 @@ type GenericCSI struct { type SnapshotController struct { // Addon strategy used to deploy the snapshot controller to the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` } @@ -197,8 +196,7 @@ type CSIProvider struct { StorageClassConfigs map[string]StorageClassConfig `json:"storageClassConfigs"` // Addon strategy used to deploy the CSI provider to the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` // The reference to any secret used by the CSI Provider. @@ -240,8 +238,7 @@ type CCM struct { Credentials *CCMCredentials `json:"credentials,omitempty"` // Addon strategy used to deploy the CCM to the workload cluster. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon + // +kubebuilder:default=HelmAddon Strategy AddonStrategy `json:"strategy"` } diff --git a/api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml b/api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml index c1a6926ec..9bf213c54 100644 --- a/api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml +++ b/api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml @@ -65,6 +65,7 @@ spec: - secretRef type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CCM to the workload cluster. enum: - ClusterResourceSet @@ -77,6 +78,7 @@ spec: description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon. properties: strategy: + default: HelmAddon description: |- Addon strategy used to deploy cluster-autoscaler to the management cluster targeting the workload cluster. @@ -97,6 +99,7 @@ spec: - Cilium type: string strategy: + default: HelmAddon description: Addon strategy used to deploy the CNI provider to the workload cluster. enum: - ClusterResourceSet @@ -176,6 +179,7 @@ spec: description: StorageClassConfigs is a map of storage class configurations for this CSI provider. type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CSI provider to the workload cluster. enum: - ClusterResourceSet @@ -192,6 +196,7 @@ spec: description: Deploy the CSI snapshot controller and associated CRDs. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy the snapshot controller to the workload cluster. enum: - ClusterResourceSet @@ -208,6 +213,7 @@ spec: description: NFD tells us to enable or disable the node feature discovery addon. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster. enum: - ClusterResourceSet diff --git a/api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml b/api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml index c86fbd451..507d38338 100644 --- a/api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml +++ b/api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml @@ -65,6 +65,7 @@ spec: - secretRef type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CCM to the workload cluster. enum: - ClusterResourceSet @@ -77,6 +78,7 @@ spec: description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon. properties: strategy: + default: HelmAddon description: |- Addon strategy used to deploy cluster-autoscaler to the management cluster targeting the workload cluster. @@ -97,6 +99,7 @@ spec: - Cilium type: string strategy: + default: HelmAddon description: Addon strategy used to deploy the CNI provider to the workload cluster. enum: - ClusterResourceSet @@ -176,6 +179,7 @@ spec: description: StorageClassConfigs is a map of storage class configurations for this CSI provider. type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CSI provider to the workload cluster. enum: - ClusterResourceSet @@ -192,6 +196,7 @@ spec: description: Deploy the CSI snapshot controller and associated CRDs. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy the snapshot controller to the workload cluster. enum: - ClusterResourceSet @@ -208,6 +213,7 @@ spec: description: NFD tells us to enable or disable the node feature discovery addon. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster. enum: - ClusterResourceSet diff --git a/api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml b/api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml index f780c5d0e..0a5dba596 100644 --- a/api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml +++ b/api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml @@ -65,6 +65,7 @@ spec: - secretRef type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CCM to the workload cluster. enum: - ClusterResourceSet @@ -77,6 +78,7 @@ spec: description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon. properties: strategy: + default: HelmAddon description: |- Addon strategy used to deploy cluster-autoscaler to the management cluster targeting the workload cluster. @@ -97,6 +99,7 @@ spec: - Cilium type: string strategy: + default: HelmAddon description: Addon strategy used to deploy the CNI provider to the workload cluster. enum: - ClusterResourceSet @@ -176,6 +179,7 @@ spec: description: StorageClassConfigs is a map of storage class configurations for this CSI provider. type: object strategy: + default: HelmAddon description: Addon strategy used to deploy the CSI provider to the workload cluster. enum: - ClusterResourceSet @@ -192,6 +196,7 @@ spec: description: Deploy the CSI snapshot controller and associated CRDs. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy the snapshot controller to the workload cluster. enum: - ClusterResourceSet @@ -208,6 +213,7 @@ spec: description: NFD tells us to enable or disable the node feature discovery addon. properties: strategy: + default: HelmAddon description: Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster. enum: - ClusterResourceSet diff --git a/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml index 9c8a7cfb0..f0bb339c6 100644 --- a/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml @@ -21,13 +21,10 @@ spec: - name: clusterConfig value: addons: - ccm: - strategy: HelmAddon - clusterAutoscaler: - strategy: HelmAddon + ccm: {} + clusterAutoscaler: {} cni: provider: Calico - strategy: HelmAddon csi: defaultStorage: provider: aws-ebs @@ -36,11 +33,8 @@ spec: aws-ebs: storageClassConfigs: default: {} - strategy: HelmAddon - snapshotController: - strategy: HelmAddon - nfd: - strategy: HelmAddon + snapshotController: {} + nfd: {} aws: region: us-west-2 controlPlane: diff --git a/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml index c58ecc9e5..45199b072 100644 --- a/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml @@ -21,13 +21,10 @@ spec: - name: clusterConfig value: addons: - ccm: - strategy: HelmAddon - clusterAutoscaler: - strategy: HelmAddon + ccm: {} + clusterAutoscaler: {} cni: provider: Cilium - strategy: HelmAddon csi: defaultStorage: provider: aws-ebs @@ -36,11 +33,8 @@ spec: aws-ebs: storageClassConfigs: default: {} - strategy: HelmAddon - snapshotController: - strategy: HelmAddon - nfd: - strategy: HelmAddon + snapshotController: {} + nfd: {} aws: region: us-west-2 controlPlane: diff --git a/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml index 1ee20edff..ac72a5ebb 100644 --- a/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml @@ -22,11 +22,9 @@ spec: - name: clusterConfig value: addons: - clusterAutoscaler: - strategy: HelmAddon + clusterAutoscaler: {} cni: provider: Calico - strategy: HelmAddon csi: defaultStorage: provider: local-path @@ -35,11 +33,8 @@ spec: local-path: storageClassConfigs: default: {} - strategy: HelmAddon - snapshotController: - strategy: HelmAddon - nfd: - strategy: HelmAddon + snapshotController: {} + nfd: {} encryptionAtRest: providers: - aescbc: {} diff --git a/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml index aa71f8a7b..c77260de9 100644 --- a/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml @@ -22,11 +22,9 @@ spec: - name: clusterConfig value: addons: - clusterAutoscaler: - strategy: HelmAddon + clusterAutoscaler: {} cni: provider: Cilium - strategy: HelmAddon csi: defaultStorage: provider: local-path @@ -35,11 +33,8 @@ spec: local-path: storageClassConfigs: default: {} - strategy: HelmAddon - snapshotController: - strategy: HelmAddon - nfd: - strategy: HelmAddon + snapshotController: {} + nfd: {} encryptionAtRest: providers: - aescbc: {} diff --git a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml index c7c434e74..f97476714 100644 --- a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml @@ -68,11 +68,9 @@ spec: secretRef: name: ${CLUSTER_NAME}-pc-creds strategy: HelmAddon - clusterAutoscaler: - strategy: HelmAddon + clusterAutoscaler: {} cni: provider: Calico - strategy: HelmAddon csi: defaultStorage: provider: nutanix @@ -89,8 +87,7 @@ spec: strategy: HelmAddon snapshotController: strategy: HelmAddon - nfd: - strategy: HelmAddon + nfd: {} controlPlane: nutanix: machineDetails: diff --git a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml index a7b501a43..18009e2d7 100644 --- a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml @@ -68,11 +68,9 @@ spec: secretRef: name: ${CLUSTER_NAME}-pc-creds strategy: HelmAddon - clusterAutoscaler: - strategy: HelmAddon + clusterAutoscaler: {} cni: provider: Cilium - strategy: HelmAddon csi: defaultStorage: provider: nutanix @@ -89,8 +87,7 @@ spec: strategy: HelmAddon snapshotController: strategy: HelmAddon - nfd: - strategy: HelmAddon + nfd: {} controlPlane: nutanix: machineDetails: diff --git a/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl index f28b5df35..4b2aac093 100644 --- a/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl @@ -14,9 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/calico.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml - - target: - kind: Cluster - path: ../../../../../patches/aws/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl index 255746f78..485aa607f 100644 --- a/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl @@ -14,9 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/cilium.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml - - target: - kind: Cluster - path: ../../../../../patches/aws/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl index 7e44f63f5..1537557f4 100644 --- a/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl @@ -14,9 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/calico.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml - - target: - kind: Cluster - path: ../../../../../patches/docker/csi-helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl index 51af2f960..5d25f9583 100644 --- a/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl @@ -14,9 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/cilium.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml - - target: - kind: Cluster - path: ../../../../../patches/docker/csi-helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/nutanix/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/nutanix/calico/helm-addon/kustomization.yaml.tmpl index d2ffaa757..3e3041773 100644 --- a/hack/examples/overlays/clusters/nutanix/calico/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/nutanix/calico/helm-addon/kustomization.yaml.tmpl @@ -14,6 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/calico.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/nutanix/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/nutanix/cilium/helm-addon/kustomization.yaml.tmpl index 82bb89906..6e697edca 100644 --- a/hack/examples/overlays/clusters/nutanix/cilium/helm-addon/kustomization.yaml.tmpl +++ b/hack/examples/overlays/clusters/nutanix/cilium/helm-addon/kustomization.yaml.tmpl @@ -14,6 +14,3 @@ patches: - target: kind: Cluster path: ../../../../../patches/cilium.yaml - - target: - kind: Cluster - path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/patches/aws/helm-addon-strategy.yaml b/hack/examples/patches/aws/helm-addon-strategy.yaml deleted file mode 100644 index 932966bb2..000000000 --- a/hack/examples/patches/aws/helm-addon-strategy.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2024 Nutanix. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -- op: "add" - path: "/spec/topology/variables/0/value/addons/csi/providers/aws-ebs/strategy" - value: HelmAddon -- op: "add" - path: "/spec/topology/variables/0/value/addons/csi/snapshotController/strategy" - value: HelmAddon -- op: "add" - path: "/spec/topology/variables/0/value/addons/ccm/strategy" - value: HelmAddon diff --git a/hack/examples/patches/docker/csi-helm-addon-strategy.yaml b/hack/examples/patches/docker/csi-helm-addon-strategy.yaml deleted file mode 100644 index 98f8efdea..000000000 --- a/hack/examples/patches/docker/csi-helm-addon-strategy.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2024 Nutanix. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -- op: "add" - path: "/spec/topology/variables/0/value/addons/csi/providers/local-path/strategy" - value: HelmAddon -- op: "add" - path: "/spec/topology/variables/0/value/addons/csi/snapshotController/strategy" - value: HelmAddon diff --git a/hack/examples/patches/helm-addon-strategy.yaml b/hack/examples/patches/helm-addon-strategy.yaml deleted file mode 100644 index a327e9a8d..000000000 --- a/hack/examples/patches/helm-addon-strategy.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2024 Nutanix. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -- op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler/strategy" - value: HelmAddon -- op: "add" - path: "/spec/topology/variables/0/value/addons/cni/strategy" - value: HelmAddon -- op: "add" - path: "/spec/topology/variables/0/value/addons/nfd/strategy" - value: HelmAddon