From 9b9dedf24cc4ca0ae276dd6439c6869a2cb85a68 Mon Sep 17 00:00:00 2001 From: Devesh Sharma Date: Tue, 27 Aug 2024 12:59:23 +0530 Subject: [PATCH] Added SelfManaged azureClusterAPi Signed-off-by: Devesh Sharma --- .../charts/azure/templates/AzureCluster.yaml | 41 +++++++++ .../azure/templates/AzureClusterIdentity.yaml | 1 + .../azure/templates/AzureMachinePool.yaml | 25 ++++++ .../azure/templates/AzureMachineTemplate.yaml | 32 +++++++ .../azure/templates/AzureManagedCluster.yaml | 2 + .../templates/AzureManagedControlPlane.yaml | 2 + .../azure/templates/MachineDeployment.yaml | 80 ++++++++++++++++++ .../templates/SelfSystemMachinePool.yaml | 59 +++++++++++++ .../azure/templates/SelfUserMachinePool.yaml | 29 +++++++ .../azure/templates/SystemMachinePool.yaml | 2 + .../templates/SystemManagedMachiePool.yaml | 2 + .../azure/templates/UserMachinePool.yaml | 4 +- .../templates/UserManagedMachinePool.yaml | 2 + .../charts/azure/templates/cluster.yaml | 6 +- .../templates/kubeadmConfigTemplate.yaml | 23 +++++ .../azure/templates/kubeadmControlPlane.yaml | 70 ++++++++++++++++ .../azure/templates/selfMnagedCluster.yaml | 21 +++++ .../capi-cluster/charts/azure/values.yaml | 84 ++++++++++--------- 18 files changed, 442 insertions(+), 43 deletions(-) create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/AzureCluster.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachinePool.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachineTemplate.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/SelfSystemMachinePool.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/SelfUserMachinePool.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmConfigTemplate.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmControlPlane.yaml create mode 100644 argocd-helm-charts/capi-cluster/charts/azure/templates/selfMnagedCluster.yaml diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureCluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureCluster.yaml new file mode 100644 index 000000000..45fa4361b --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureCluster.yaml @@ -0,0 +1,41 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureCluster +metadata: + name: {{ .Values.global.clusterName }} + namespace: {{ .Release.Namespace }} +spec: + location: {{ .Values.location }} + resourceGroup: {{ .Values.resourceGroup }} + subscriptionID: {{ .Values.subscriptionID }} + identityRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureClusterIdentity + name: {{ .Values.global.clusterName }}-cluster-identity + bastionSpec: + azureBastion: + enableTunneling: true + name: bastion + publicIP: + name: bastion + sku: Standard + subnet: + name: AzureBastionSubnet + + networkSpec: + apiServerLB: + type: {{ .Values.selfManagedCluster.apiLoadbalancer }} + vnet: + name: {{ .Values.global.virtualNetwork.name }} + {{- if ne .Values.global.virtualNetwork.cidrBlock "" }} + cidrBlocks: + - {{ .Values.global.virtualNetwork.cidrBlock | toString }} + {{- end }} + subnets: + - name: {{ .Values.global.virtualNetwork.subnet.name }} + role: node + {{- if ne .Values.global.virtualNetwork.subnet.cidrBlock "" }} + cidrBlocks: + - {{ .Values.global.virtualNetwork.subnet.cidrBlock | toString }} + {{- end }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureClusterIdentity.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureClusterIdentity.yaml index 4829e4dc5..c58560626 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureClusterIdentity.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureClusterIdentity.yaml @@ -6,6 +6,7 @@ metadata: name: {{ .Values.global.clusterName }}-cluster-identity namespace: {{ .Release.Namespace }} spec: + type: WorkloadIdentity allowedNamespaces: list: - {{ .Release.Namespace }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachinePool.yaml new file mode 100644 index 000000000..b5b7b56da --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachinePool.yaml @@ -0,0 +1,25 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureMachinePool +metadata: + name: spool1 + namespace: {{ .Release.Namespace }} +spec: + location: {{ .Values.location }} + template: + osDisk: + diskSizeGB: {{ .Values.systemPool.osDiskSizeGB }} + managedDisk: + storageAccountType: Standard_LRS + vmSize: {{ .Values.systemPool.sku }} + sshPublicKey: {{ .Values.sshPublicKey | b64enc }} + strategy: + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + additionalTags: +{{- with .Values.additionalTags }} +{{ toYaml . | indent 6 }} +{{- end }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachineTemplate.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachineTemplate.yaml new file mode 100644 index 000000000..c4b01d394 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachineTemplate.yaml @@ -0,0 +1,32 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureMachineTemplate +metadata: + name: {{ .Values.global.clusterName }}-system + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + vmSize: {{ .Values.systemPool.sku }} + osDisk: + diskSizeGB: {{ .Values.systemPool.osDiskSizeGB }} + osType: Linux + sshPublicKey: {{ .Values.sshPublicKey | b64enc }} +{{- end }} +--- +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureMachineTemplate +metadata: + name: {{ .Values.global.clusterName }}-user + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + vmSize: {{ .Values.userPool.sku }} + osDisk: + diskSizeGB: {{ .Values.userPool.osDiskSizeGB }} + osType: Linux + sshPublicKey: {{ .Values.sshPublicKey | b64enc }} +{{- end }} +--- diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml index 903b8865c..dde237590 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml @@ -1,5 +1,7 @@ +{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedCluster metadata: name: {{ .Values.global.clusterName }} namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml index 4bee0441d..d285dd317 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedControlPlane metadata: @@ -32,3 +33,4 @@ spec: identityRef: name: {{ .Values.global.clusterName }}-cluster-identity kind: AzureClusterIdentity +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml new file mode 100644 index 000000000..2ae947a0c --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml @@ -0,0 +1,80 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachineDeployment +metadata: + name: {{ .Values.global.clusterName }}-md-0 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + replicas: 1 + selector: + matchLabels: null + template: + spec: + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachineTemplate + name: {{ .Values.global.clusterName }}-system + version: {{ .Values.global.kubernetes.version }} + failureDomain: "1" +{{- end }} +--- +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachineDeployment +metadata: + name: {{ .Values.global.clusterName }}-md-1 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + replicas: 1 + selector: + matchLabels: null + template: + spec: + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachineTemplate + name: {{ .Values.global.clusterName }}-system + version: {{ .Values.global.kubernetes.version }} + failureDomain: "2" +{{- end }} +--- +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachineDeployment +metadata: + name: {{ .Values.global.clusterName }}-md-2 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + replicas: 1 + selector: + matchLabels: null + template: + spec: + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachineTemplate + name: {{ .Values.global.clusterName }}-system + version: {{ .Values.global.kubernetes.version }} + failureDomain: "3" +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfSystemMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfSystemMachinePool.yaml new file mode 100644 index 000000000..da8ff2480 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfSystemMachinePool.yaml @@ -0,0 +1,59 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + labels: + cluster.x-k8s.io/cluster-name: {{ .Values.global.clusterName }} + name: {{ .Values.global.clusterName }}-vmu-0 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + failureDomains: + - "1" + - "3" + replicas: 3 + template: + spec: + clusterName: {{ .Values.global.clusterName }} + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachinePool + name: spool1 + version: {{ .Values.global.kubernetes.version }} +{{- end }} +--- +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + labels: + cluster.x-k8s.io/cluster-name: {{ .Values.global.clusterName }} + name: {{ .Values.global.clusterName }}-vmus-0 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + failureDomains: + - "1" + - "3" + replicas: 3 + template: + spec: + clusterName: {{ .Values.global.clusterName }} + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachinePool + name: spool1 + version: {{ .Values.global.kubernetes.version }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfUserMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfUserMachinePool.yaml new file mode 100644 index 000000000..b61803b27 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SelfUserMachinePool.yaml @@ -0,0 +1,29 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + labels: + cluster.x-k8s.io/cluster-name: {{ .Values.global.clusterName }} + name: {{ .Values.global.clusterName }}-vmu-0 + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + failureDomains: + - "1" + - "3" + replicas: 3 + template: + spec: + clusterName: {{ .Values.global.clusterName }} + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: {{ .Values.global.clusterName }}-md-0 + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachineTemplate + name: {{ .Values.global.clusterName }}-user + version: {{ .Values.global.kubernetes.version }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemMachinePool.yaml index dcaac0c3e..411c02c49 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemMachinePool.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemMachinePool.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: @@ -17,3 +18,4 @@ spec: version: {{ .Values.global.kubernetes.version }} bootstrap: dataSecretName: {{ .Values.global.clientSecret}} +{{- end }} \ No newline at end of file diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml index 0151d013e..227d117a1 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedMachinePool metadata: @@ -6,3 +7,4 @@ spec: mode: System osDiskSizeGB: {{ .Values.systemPool.osDiskSizeGB }} sku: {{ .Values.systemPool.sku }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml index fbd3f4389..c252b1e40 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: @@ -16,4 +17,5 @@ spec: namespace: {{ .Release.Namespace }} version: {{ .Values.global.kubernetes.version }} bootstrap: - dataSecretName: {{ .Values.global.clientSecret}} \ No newline at end of file + dataSecretName: {{ .Values.global.clientSecret}} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml index ef6cd473d..5a6a63cfd 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedMachinePool metadata: @@ -6,3 +7,4 @@ spec: mode: User osDiskSizeGB: {{ .Values.userPool.osDiskSizeGB }} sku: {{ .Values.userPool.sku }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml index afef385ff..e3c7ed3a3 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml @@ -1,3 +1,4 @@ +{{- if .Values.managedCluster }} apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: @@ -9,14 +10,11 @@ spec: cidrBlocks: - {{ .Values.global.clusterNetwork.services.cidrBlocks }} controlPlaneRef: -{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedControlPlane name: {{ .Values.global.clusterName }}-control-plane -{{- end }} infrastructureRef: -{{- if .Values.managedCluster }} apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureManagedCluster name: {{ .Values.global.clusterName }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmConfigTemplate.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmConfigTemplate.yaml new file mode 100644 index 000000000..fd9ca9e11 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmConfigTemplate.yaml @@ -0,0 +1,23 @@ +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 +kind: KubeadmConfigTemplate +metadata: + name: {{ .Values.global.clusterName }}-md-0 + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + files: + - contentFrom: + secret: + key: sp.json + name: {{ .Values.selfManagedCluster.clientSecret.workerNodeAzure }} + owner: root:root + path: /etc/kubernetes/azure.json + permissions: "0644" + joinConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-provider: external + name: {{ .Values.selfManagedCluster.localHostname }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmControlPlane.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmControlPlane.yaml new file mode 100644 index 000000000..42a5de511 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/kubeadmControlPlane.yaml @@ -0,0 +1,70 @@ +{{- if .Values.selfManagedCluster.enabled }} +# for testing need to update +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 +kind: KubeadmControlPlane +metadata: + name: {{ .Values.global.clusterName }}-control-plane + namespace: {{ .Release.Namespace }} +spec: + kubeadmConfigSpec: + clusterConfiguration: + apiServer: + extraArgs: + cloud-provider: external + timeoutForControlPlane: 20m + controllerManager: + extraArgs: + allocate-node-cidrs: "true" + cloud-provider: external + cluster-name: {{ .Values.global.clusterName }} + etcd: + local: + dataDir: /var/lib/etcddisk/etcd + extraArgs: + quota-backend-bytes: "8589934592" + diskSetup: + filesystems: + - device: /dev/disk/azure/scsi1/lun0 + extraOpts: + - -E + - lazy_itable_init=1,lazy_journal_init=1 + filesystem: ext4 + label: etcd_disk + - device: ephemeral0.1 + filesystem: ext4 + label: ephemeral0 + replaceFS: ntfs + partitions: + - device: /dev/disk/azure/scsi1/lun0 + layout: true + overwrite: false + tableType: gpt + files: + - contentFrom: + secret: + key: sp.json + name: {{ .Values.selfManagedCluster.clientSecret.ControlplanSecret }} + owner: root:root + path: /etc/kubernetes/azure.json + permissions: "0644" + initConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-provider: external + name: {{ .Values.selfManagedCluster.localHostname }} + joinConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-provider: external + name: {{ .Values.selfManagedCluster.localHostname }} + mounts: + - - LABEL=etcd_disk + - /var/lib/etcddisk + machineTemplate: + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureMachineTemplate + name: {{ .Values.global.clusterName }}-system + replicas: 1 + version: {{ .Values.global.kubernetes.version }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/selfMnagedCluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/selfMnagedCluster.yaml new file mode 100644 index 000000000..490c25722 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/selfMnagedCluster.yaml @@ -0,0 +1,21 @@ +# for testing +{{- if .Values.selfManagedCluster.enabled }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + name: {{ .Values.global.clusterName }} + namespace: {{ .Release.Namespace }} +spec: + clusterNetwork: + pods: + cidrBlocks: + - {{ .Values.global.clusterNetwork.pod.cidrBlocks }} + controlPlaneRef: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlane + name: {{ .Values.global.clusterName }}-control-plane + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureCluster + name: {{ .Values.global.clusterName }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/values.yaml b/argocd-helm-charts/capi-cluster/charts/azure/values.yaml index 9be78f117..03ea6ab45 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/values.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/values.yaml @@ -1,41 +1,49 @@ - global: - clusterName: my-cluster - kubernetes: - version: "1.29.2" - networkPolicy: azure # or calico - networkPlugin: azure # or kubenet - skuTier: Free - clientSecret: mysecret - clientID: 158ac5a8-c34d-4d35-81ff-90677ce31b5d - tenantID: 3964984e-eaaf-4ac4-b3ff-b3cda81256ff - addonProfiles: - - name: azureKeyvaultSecretsProvider - enabled: true - - name: azurepolicy - enabled: true - clusterNetwork: - services: - cidrBlocks: "192.168.0.0/16" - virtualNetwork: - name: controlplan-vnet - cidrBlock: "10.1.0.0/16" - subnet: - name: controlplan-subnet - cidrBlock: "10.1.1.0/24" +global: + networkPolicy: azure # or calico + networkPlugin: azure # or kubenet + skuTier: Free + clientSecret: mysecret + clientID: 25978a8c-3db8-4481-9d0c-b516e6e0cf4c + tenantID: 3964984e-eaaf-4ac4-b3ff-b3cda81256ff + addonProfiles: + - name: azureKeyvaultSecretsProvider + enabled: true + - name: azurepolicy + enabled: true + clusterNetwork: + pod: + cidrBlocks: 192.168.0.0/16 + services: + cidrBlocks: "10.96.0.0/12" + virtualNetwork: + name: controlplan-vnet + cidrBlock: "10.1.0.0/16" + subnet: + name: controlplan-subnet + cidrBlock: "10.1.1.0/24" - systemPool: - osDiskSizeGB: 30 - sku: Standard_D2s_v3 - replica: 1 +managedCluster: false +selfManagedCluster: + enabled: true + clientSecret: + ControlplanSecret: test-control-plane-azure-json + workerNodeAzure: test-md-0-azure-json + localHostname: '{{ ds.meta_data["local_hostname"] }}' + apiLoadbalancer: Public - userPool: - osDiskSizeGB: 30 - sku: Standard_D2s_v3 - replica: 1 +systemPool: + osDiskSizeGB: 30 + sku: Standard_D2_v3 + replica: 1 - location: centralindia - resourceGroupName: cluster-api - sshPublicKey: "ssh-rsa" - subscriptionID: cce2e9ac-1580-4d82-b79f-a637f5f3e443 - additionalTags: - environment: dev +userPool: + osDiskSizeGB: 30 + sku: Standard_D2_v3 + replica: 1 + +location: centralindia +resourceGroupName: cluster-api +sshPublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrRKqLY7bihiRdr8uJnTMcfDMeQ9HOUxYHp7jBbl+Paae2nJ8tzbSGbMk9+Wqw8i5C38rlUolq6Sc1xUUDzWCXB8LCVSsIUrpWUsy5tjlq6U9r8NpypSIon48tNrLdEwtYEf1/5bYA0Y2PFTxtkZcvWtqcor7q9hiejQWrNU3CCVAt8kBGzsieT00YwCrI6AvT+Ko8xjJyDFuunIpliYjyotgXXFF2BohxKEdkuIVpS7iUGQxF993tKQNaMtkKnuU9ijLFhdp41Rk8lSCc1x+oavUbR+ACtbZwlYnc7lcOAJUP3HEQ6ewR5W1zuASlRyR5Mr9sJ0vGf7zbkTAk3VGRlGRVXyU+rZUkqGm71LyKBkptxv32MD/HGbnE81KeJXm7tvLJvr96ssOn3AuBiPEppNAhtqN7Xo/7aYOfkaBxYpddJQ9uhAXdmVTRNnQuRIJK4vWI1o5urJ+1VJ1WawX6QdFOc+3Wbi2JGeyxtweYGIFjcwqkD3gbWtoSb4XLKHE= davesh.sharma@LM2RTXP4K9" +subscriptionID: cce2e9ac-1580-4d82-b79f-a637f5f3e443 +additionalTags: + environment: dev