diff --git a/argocd-helm-charts/capi-cluster/charts/azure/Chart.yaml b/argocd-helm-charts/capi-cluster/charts/azure/Chart.yaml new file mode 100644 index 000000000..49cf8715c --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: azure +version: 1.0.0 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..42325fa14 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureCluster.yaml @@ -0,0 +1,21 @@ +{{- if .Values.selfmangedCluster }} +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 }} + networkSpec: + vnet: + name: {{ .Values.global.virtualNetwork.name }} + cidrBlocks: + - {{ .Values.global.virtualNetwork.cidrBlock | toString }} + subnets: + - name: {{ .Values.global.virtualNetwork.subnet.name }} + role: node + cidrBlocks: + - {{ .Values.global.virtualNetwork.subnet.cidrBlock | toString }} +{{- 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 new file mode 100644 index 000000000..4829e4dc5 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureClusterIdentity.yaml @@ -0,0 +1,18 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureClusterIdentity +metadata: + labels: + clusterctl.cluster.x-k8s.io/move-hierarchy: "true" + name: {{ .Values.global.clusterName }}-cluster-identity + namespace: {{ .Release.Namespace }} +spec: + allowedNamespaces: + list: + - {{ .Release.Namespace }} + clientID: {{ .Values.global.clientID}} + clientSecret: + name: {{ .Values.global.clientSecret}} + namespace: {{ .Release.Namespace }} + tenantID: {{ .Values.global.tenantID }} + type: ServicePrincipal + \ No newline at end of file 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..be72fcc8e --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureMachinePool.yaml @@ -0,0 +1,25 @@ +{{- if .Values.selfmangedCluster }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureMachinePool +metadata: + name: spool1 + namespace: {{ .Values.metadata.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/AzureManagedCluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml new file mode 100644 index 000000000..e997ca1fd --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedCluster.yaml @@ -0,0 +1,7 @@ +{{- if .Values.managedCluster }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedCluster +metadata: + name: {{ .Values.global.clusterName }} + namespace: {{ .Release.Namespace }} +{{- end }} \ No newline at end of file diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml new file mode 100644 index 000000000..d285dd317 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/AzureManagedControlPlane.yaml @@ -0,0 +1,36 @@ +{{- if .Values.managedCluster }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedControlPlane +metadata: + name: {{ .Values.global.clusterName }}-control-plane + namespace: {{ .Release.Namespace }} +spec: + location: {{ .Values.location }} + resourceGroupName: {{ .Values.resourceGroupName }} + sshPublicKey: {{ .Values.sshPublicKey | b64enc }} + subscriptionID: {{ .Values.subscriptionID }} + version: {{ .Values.global.kubernetes.version }} + networkPolicy: {{ .Values.global.networkPolicy }} #azure # or calico + networkPlugin: {{ .Values.global.networkPlugin }} #azure # or kubenet + sku: + tier: {{ .Values.global.skuTier }} #Free # or Standard + {{- if .Values.global.addonProfiles }} + addonProfiles: + {{- range $profile := .Values.global.addonProfiles }} + - name: {{ $profile.name }} + enabled: {{ $profile.enabled }} + {{- end }} + {{- end }} + {{- if .Values.global.virtualNetwork }} + virtualNetwork: + name: {{ .Values.global.virtualNetwork.name }} + cidrBlock: {{ .Values.global.virtualNetwork.cidrBlock | toString }} + resourceGroup: {{ .Values.resourceGroupName }} + subnet: + name: {{ .Values.global.virtualNetwork.subnet.name }} + cidrBlock: {{ .Values.global.virtualNetwork.subnet.cidrBlock | toString }} + {{- end }} + identityRef: + name: {{ .Values.global.clusterName }}-cluster-identity + kind: AzureClusterIdentity +{{- 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 new file mode 100644 index 000000000..dcaac0c3e --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemMachinePool.yaml @@ -0,0 +1,19 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: {{ .Values.global.clusterName}}-systempool + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + replicas: {{ .Values.systemPool.replicas }} + template: + spec: + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: mspool01 + namespace: {{ .Release.Namespace }} + version: {{ .Values.global.kubernetes.version }} + bootstrap: + dataSecretName: {{ .Values.global.clientSecret}} diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml new file mode 100644 index 000000000..7de0d6aab --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/SystemManagedMachiePool.yaml @@ -0,0 +1,10 @@ +{{- if .Values.managedCluster }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: mspool01 +spec: + mode: System + osDiskSizeGB: {{ .Values.systemPool.osDiskSizeGB }} + sku: {{ .Values.systemPool.sku }} +{{- end }} \ No newline at end of file diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml new file mode 100644 index 000000000..85427c9d3 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserMachinePool.yaml @@ -0,0 +1,21 @@ +{{- if .Values.managedCluster }} +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: {{ .Values.global.clusterName}}-userpool + namespace: {{ .Release.Namespace }} +spec: + clusterName: {{ .Values.global.clusterName }} + replicas: {{ .Values.userPool.replicas }} + template: + spec: + clusterName: {{ .Values.global.clusterName }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: mupool01 + namespace: {{ .Release.Namespace }} + 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/UserManagedMachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml new file mode 100644 index 000000000..8d5301af2 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/UserManagedMachinePool.yaml @@ -0,0 +1,10 @@ +{{- if .Values.managedCluster }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: mupool01 +spec: + mode: User + osDiskSizeGB: {{ .Values.userPool.osDiskSizeGB }} + sku: {{ .Values.userPool.sku }} +{{- end }} \ No newline at end of file diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml new file mode 100644 index 000000000..afef385ff --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/cluster.yaml @@ -0,0 +1,22 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + name: {{ .Values.global.clusterName }} + namespace: {{ .Release.Namespace }} +spec: + clusterNetwork: + services: + 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 diff --git a/argocd-helm-charts/capi-cluster/charts/azure/values.yaml b/argocd-helm-charts/capi-cluster/charts/azure/values.yaml new file mode 100644 index 000000000..a1a3f4920 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/charts/azure/values.yaml @@ -0,0 +1,44 @@ +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" + +managedCluster: true +selfManagedCluster: false + +systemPool: + osDiskSizeGB: 30 + sku: Standard_D2s_v3 + replica: 1 + +userPool: + osDiskSizeGB: 30 + sku: Standard_D2s_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 diff --git a/argocd-helm-charts/capi-cluster/templates/ccm-azure.yaml b/argocd-helm-charts/capi-cluster/templates/ccm-azure.yaml new file mode 100644 index 000000000..906403eb3 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/templates/ccm-azure.yaml @@ -0,0 +1,22 @@ +{{- if (.Values.provider).azure }} +apiVersion: addons.cluster.x-k8s.io/v1alpha1 +kind: HelmChartProxy +metadata: + name: ccm-azure-{{ .Values.global.clusterName }} +spec: + clusterSelector: + matchLabels: + cluster.x-k8s.io/name: {{ .Values.global.clusterName }} + repoURL: https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo + chartName: cloud-provider-azure + namespace: kube-system + releaseName: cloud-provider-azure + version: 1.30.3 + options: + waitForJobs: true + wait: true + timeout: 5m0s + valuesTemplate: | + infra: + clusterName: {{ .Values.global.clusterName }} +{{- end }} diff --git a/argocd-helm-charts/capi-cluster/templates/cilium.yaml b/argocd-helm-charts/capi-cluster/templates/cilium.yaml index 0adedbf6b..df8a9155c 100644 --- a/argocd-helm-charts/capi-cluster/templates/cilium.yaml +++ b/argocd-helm-charts/capi-cluster/templates/cilium.yaml @@ -1,3 +1,4 @@ +{{- if (.Values.provider).aws }} apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: @@ -44,3 +45,4 @@ spec: ui: enabled: true rollOutPods: true +{{- end }} \ No newline at end of file diff --git a/argocd-helm-charts/capi-cluster/templates/provider-azure.yaml b/argocd-helm-charts/capi-cluster/templates/provider-azure.yaml new file mode 100644 index 000000000..7929df779 --- /dev/null +++ b/argocd-helm-charts/capi-cluster/templates/provider-azure.yaml @@ -0,0 +1,16 @@ +{{- if (.Values.provider).azure }} +# Need to work on this, not completed +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: InfrastructureProvider +metadata: + name: azure-{{ .Values.global.customerid }} + namespace: {{ .Release.Namespace }} +spec: + version: {{ .Values.global.capz.version }} + fetchConfig: + url: https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/download/{{ .Values.global.capz.version }}/infrastructure-components.yaml + manager: + metrics: + bindAddress: ":8443" + syncPeriod: 10m0s +{{- end }}