Skip to content

feat: Use HelmAddon as default addon strategy #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions api/v1alpha1/addon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -104,26 +106,24 @@ 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"`
}

// ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon.
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"`
}

Expand All @@ -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"`
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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"`
}

Expand Down
6 changes: 6 additions & 0 deletions api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
14 changes: 4 additions & 10 deletions examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
14 changes: 4 additions & 10 deletions examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
11 changes: 3 additions & 8 deletions examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ spec:
- name: clusterConfig
value:
addons:
clusterAutoscaler:
strategy: HelmAddon
clusterAutoscaler: {}
cni:
provider: Calico
strategy: HelmAddon
csi:
defaultStorage:
provider: local-path
Expand All @@ -35,11 +33,8 @@ spec:
local-path:
storageClassConfigs:
default: {}
strategy: HelmAddon
snapshotController:
strategy: HelmAddon
nfd:
strategy: HelmAddon
snapshotController: {}
nfd: {}
encryptionAtRest:
providers:
- aescbc: {}
Expand Down
11 changes: 3 additions & 8 deletions examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ spec:
- name: clusterConfig
value:
addons:
clusterAutoscaler:
strategy: HelmAddon
clusterAutoscaler: {}
cni:
provider: Cilium
strategy: HelmAddon
csi:
defaultStorage:
provider: local-path
Expand All @@ -35,11 +33,8 @@ spec:
local-path:
storageClassConfigs:
default: {}
strategy: HelmAddon
snapshotController:
strategy: HelmAddon
nfd:
strategy: HelmAddon
snapshotController: {}
nfd: {}
encryptionAtRest:
providers:
- aescbc: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -89,8 +87,7 @@ spec:
strategy: HelmAddon
snapshotController:
strategy: HelmAddon
nfd:
strategy: HelmAddon
nfd: {}
controlPlane:
nutanix:
machineDetails:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -89,8 +87,7 @@ spec:
strategy: HelmAddon
snapshotController:
strategy: HelmAddon
nfd:
strategy: HelmAddon
nfd: {}
controlPlane:
nutanix:
machineDetails:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading