diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1bb4614 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.code-workspace \ No newline at end of file diff --git a/charts/azure-managed-cluster/.helmignore b/charts/azure-managed-cluster/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/azure-managed-cluster/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/azure-managed-cluster/Chart.yaml b/charts/azure-managed-cluster/Chart.yaml new file mode 100644 index 0000000..7b67aa2 --- /dev/null +++ b/charts/azure-managed-cluster/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: azure-managed-cluster +description: A Helm chart to deploy an AKS cluster via the cluster-api-provider-azure ManagedCluster +type: application +maintainers: +- email: jt572@cornell.edu + name: Jont828 +version: 0.2.0 +appVersion: 1.16.0 diff --git a/charts/azure-managed-cluster/templates/_helpers.tpl b/charts/azure-managed-cluster/templates/_helpers.tpl new file mode 100644 index 0000000..ade3bea --- /dev/null +++ b/charts/azure-managed-cluster/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "azure-managed-cluster.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "azure-managed-cluster.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "azure-managed-cluster.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "azure-managed-cluster.labels" -}} +helm.sh/chart: {{ include "azure-managed-cluster.chart" . }} +{{ include "azure-managed-cluster.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "azure-managed-cluster.selectorLabels" -}} +app.kubernetes.io/name: {{ include "azure-managed-cluster.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "azure-managed-cluster.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "azure-managed-cluster.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/azure-managed-cluster/templates/agentpools.yaml b/charts/azure-managed-cluster/templates/agentpools.yaml new file mode 100644 index 0000000..96a87f3 --- /dev/null +++ b/charts/azure-managed-cluster/templates/agentpools.yaml @@ -0,0 +1,200 @@ +{{- if not .Values.agentpools }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: {{ .Values.cluster.name | default .Release.Name }}pool0 +spec: + name: {{ .Values.cluster.name | default .Release.Name }}pool0 + scaling: + minSize: {{ .Values.defaults.agentPool.scaling.minSize }} + maxSize: {{ .Values.defaults.agentPool.scaling.maxSize }} + osDiskSizeGB: {{ .Values.defaults.agentPool.osDiskSizeGB }} + sku: {{ .Values.defaults.agentPool.sku }} + availabilityZones: + {{- range .Values.defaults.agentPool.availabilityZones }} + - {{ . | quote }} + {{- end }} + nodeLabels: + {{- range $nodeLabels := .Values.defaults.agentPool.nodeLabels }} + {{ $nodeLabels.key }}: {{ $nodeLabels.value }} + {{- end }} + mode: System + maxPods: {{ .Values.defaults.agentPool.maxPods }} + osDiskType: {{ .Values.defaults.agentPool.osDiskType }} + enableUltraSSD: {{ .Values.defaults.agentPool.enableUltraSSD }} + osType: {{ .Values.defaults.agentPool.osType }} + enableNodePublicIP: {{ .Values.defaults.agentPool.enableNodePublicIP }} + nodePublicIPPrefixID: {{ .Values.defaults.agentPool.nodePublicIPPrefixID }} + scaleSetPriority: {{ .Values.defaults.agentPool.scaleSetPriority }} + scaleDownMode: {{ .Values.defaults.agentPool.scaleDownMode }} + spotMaxPrice: {{ .Values.defaults.agentPool.spotMaxPrice }} + kubeletConfig: {{ .Values.defaults.agentPool.kubeletConfig }} + kubeletDiskType: {{ .Values.defaults.agentPool.kubeletDiskType }} + linuxOSConfig: {{ .Values.defaults.agentPool.linuxOSConfig }} + subnetName: {{ .Values.defaults.agentPool.subnetName }} + enableFIPS: {{ .Values.defaults.agentPool.enableFIPS }} + enableEncryptionAtHost: {{ .Values.defaults.agentPool.enableEncryptionAtHost }} +--- +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: {{ .Values.cluster.name | default .Release.Name }}pool0 +spec: + clusterName: {{ .Values.cluster.name | default .Release.Name }} + replicas: {{ .Values.defaults.agentPool.nodecount }} + template: + metadata: {} + spec: + bootstrap: + dataSecretName: "" + clusterName: {{ .Values.cluster.name | default .Release.Name }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: {{ .Values.cluster.name | default .Release.Name }}pool0 + namespace: {{ $.Release.Namespace }} + version: {{ .Values.controlplane.kubernetes_version }} +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: {{ .Values.cluster.name | default .Release.Name }}pool1 +spec: + name: {{ .Values.cluster.name | default .Release.Name }}pool1 + scaling: + minSize: {{ .Values.defaults.agentPool.scaling.minSize }} + maxSize: {{ .Values.defaults.agentPool.scaling.maxSize }} + osDiskSizeGB: {{ .Values.defaults.agentPool.osDiskSizeGB }} + sku: {{ .Values.defaults.agentPool.sku }} + availabilityZones: + {{- range .Values.defaults.agentPool.availabilityZones }} + - {{ . | quote }} + {{- end }} + nodeLabels: + {{- range $nodeLabels := .Values.defaults.agentPool.nodeLabels }} + {{ $nodeLabels.key }}: {{ $nodeLabels.value }} + {{- end }} + mode: User + maxPods: {{ .Values.defaults.agentPool.maxPods }} + osDiskType: {{ .Values.defaults.agentPool.osDiskType }} + enableUltraSSD: {{ .Values.defaults.agentPool.enableUltraSSD }} + osType: {{ .Values.defaults.agentPool.osType }} + enableNodePublicIP: {{ .Values.defaults.agentPool.enableNodePublicIP }} + nodePublicIPPrefixID: {{ .Values.defaults.agentPool.nodePublicIPPrefixID }} + scaleSetPriority: {{ .Values.defaults.agentPool.scaleSetPriority }} + scaleDownMode: {{ .Values.defaults.agentPool.scaleDownMode }} + spotMaxPrice: {{ .Values.defaults.agentPool.spotMaxPrice }} + kubeletConfig: {{ .Values.defaults.agentPool.kubeletConfig }} + kubeletDiskType: {{ .Values.defaults.agentPool.kubeletDiskType }} + linuxOSConfig: {{ .Values.defaults.agentPool.linuxOSConfig }} + subnetName: {{ .Values.defaults.agentPool.subnetName }} + enableFIPS: {{ .Values.defaults.agentPool.enableFIPS }} + enableEncryptionAtHost: {{ .Values.defaults.agentPool.enableEncryptionAtHost }} +--- +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: {{ .Values.cluster.name | default .Release.Name }}pool1 +spec: + clusterName: {{ .Values.cluster.name | default .Release.Name }} + replicas: {{ .Values.defaults.agentPool.nodecount }} + template: + metadata: {} + spec: + bootstrap: + dataSecretName: "" + clusterName: {{ .Values.cluster.name | default .Release.Name }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: {{ .Values.cluster.name | default .Release.Name }}pool1 + namespace: {{ $.Release.Namespace }} + version: {{ .Values.controlplane.kubernetes_version }} +--- +{{- else }} +{{- range $index, $agentPool := .Values.agentPools }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: {{ $agentPool.name }} +spec: + name: {{ $agentPool.name }} + scaling: + {{- if $agentPool.scaling }} + minSize: {{ $agentPool.scaling.minSize | default .Values.defaults.agentPool.scaling.minSize }} + maxSize: {{ $agentPool.scaling.maxSize | default .Values.defaults.agentPool.scaling.maxSize }} + {{- else }} + minSize: {{ .Values.defaults.agentPool.scaling.minSize }} + maxSize: {{ .Values.defaults.agentPool.scaling.maxSize }} + {{- end }} + {{- if $agentPool.additionalTags }} + additionalTags: + {{- range $additionalTags := $agentPool.additionalTags }} + {{ $additionalTags.key }}: {{ $additionalTags.value }} + {{- end }} + {{- end }} + osDiskSizeGB: {{ $agentPool.osDiskSizeGB | default .Values.defaults.agentPool.osDiskSizeGB }} + sku: {{ $agentPool.sku | default .Values.defaults.agentPool.sku }} + availabilityZones: + {{- if $agentPool.availabilityZones }} + {{- range $agentPool.availabilityZones }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.defaults.agentPool.availabilityZones }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if $agentPool.nodeLabels }} + nodeLabels: + {{- range $nodeLabels := $agentPool.nodeLabels }} + {{ $nodeLabels.key }}: {{ $nodeLabels.value }} + {{- end }} + {{- end }} + {{- if .Values.defaults.agentPool.nodeLabels }} + taints: + {{- range $taints := $agentPool.taints }} + - key: {{ $taints.key }} + value: {{ $taints.value }} + effect: {{ $taints.effect }} + {{- end }} + {{- end }} + mode: {{ $agentPool.mode | default .Values.defaults.agentPool.mode }} + maxPods: {{ $agentPool.maxPods | default .Values.defaults.agentPool.maxPods }} + osDiskType: {{ $agentPool.osDiskType | default .Values.defaults.agentPool.osDiskType }} + enableUltraSSD: {{ $agentPool.enableUltraSSD | default .Values.defaults.agentPool.enableUltraSSD }} + osType: {{ $agentPool.osType | default .Values.defaults.agentPool.osType }} + enableNodePublicIP: {{ $agentPool.enableNodePublicIP | default .Values.defaults.agentPool.enableNodePublicIP }} + nodePublicIPPrefixID: {{ $agentPool.nodePublicIPPrefixID | default .Values.defaults.agentPool.nodePublicIPPrefixID }} + scaleSetPriority: {{ $agentPool.scaleSetPriority | default .Values.defaults.agentPool.scaleSetPriority }} + scaleDownMode: {{ $agentPool.scaleDownMode | default .Values.defaults.agentPool.scaleDownMode }} + spotMaxPrice: {{ $agentPool.spotMaxPrice | default .Values.defaults.agentPool.spotMaxPrice }} + kubeletConfig: {{ $agentPool.kubeletConfig | default .Values.defaults.agentPool.kubeletConfig }} + kubeletDiskType: {{ $agentPool.kubeletDiskType | default .Values.defaults.agentPool.kubeletDiskType }} + linuxOSConfig: {{ $agentPool.linuxOSConfig | default .Values.defaults.agentPool.linuxOSConfig }} + subnetName: {{ $agentPool.subnetName | default .Values.defaults.agentPool.subnetName }} + enableFIPS: {{ $agentPool.enableFIPS | default .Values.defaults.agentPool.enableFIPS }} + enableEncryptionAtHost: {{ $agentPool.enableEncryptionAtHost | default .Values.defaults.agentPool.enableEncryptionAtHost }} +--- +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: {{ $agentPool.name }} +spec: + clusterName: {{ $.Values.cluster.name }} + replicas: {{ $agentPool.nodecount }} + template: + metadata: {} + spec: + bootstrap: + dataSecretName: "" + clusterName: {{ $.Values.cluster.name }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: {{ $agentPool.name }} + namespace: {{ $.Release.Namespace }} + version: {{ $.Values.controlplane.kubernetes_version }} +--- +{{- end }} +{{- end }} diff --git a/charts/azure-managed-cluster/templates/azureclusteridentity.yaml b/charts/azure-managed-cluster/templates/azureclusteridentity.yaml new file mode 100644 index 0000000..c6f63b0 --- /dev/null +++ b/charts/azure-managed-cluster/templates/azureclusteridentity.yaml @@ -0,0 +1,21 @@ +{{- if not (lookup "infrastructure.cluster.x-k8s.io/v1beta1" "AzureClusterIdentity" .Values.identity.clusterIdentityNamespace .Values.identity.clusterIdentityName) }} +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureClusterIdentity +metadata: + labels: + clusterctl.cluster.x-k8s.io/move-hierarchy: "true" + annotations: + helm.sh/resource-policy: keep + name: {{ $.Values.identity.clusterIdentityName }} +spec: + allowedNamespaces: + list: + - {{ $.Values.identity.clusterIdentitySecretNamespace }} + clientSecret: + name: {{ $.Values.identity.clusterIdentitySecretName }} + namespace: {{ $.Values.identity.clusterIdentitySecretNamespace }} + clientID: {{ $.Values.identity.clientID }} + tenantID: {{ $.Values.identity.tenantID }} + type: {{ $.Values.identity.type }} + resourceID: {{ $.Values.identity.resourceID }} +{{- end }} \ No newline at end of file diff --git a/charts/azure-managed-cluster/templates/azuremanagedccontrolplane.yaml b/charts/azure-managed-cluster/templates/azuremanagedccontrolplane.yaml new file mode 100644 index 0000000..447a711 --- /dev/null +++ b/charts/azure-managed-cluster/templates/azuremanagedccontrolplane.yaml @@ -0,0 +1,100 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedControlPlane +metadata: + name: {{ $.Values.cluster.name | default .Release.Name }} +spec: + identityRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureClusterIdentity + name: {{ $.Values.identity.clusterIdentityName }} + location: {{ $.Values.cluster.location }} + resourceGroupName: {{ $.Values.cluster.resourceGroupName }} + nodeResourceGroupName: {{ $.Values.cluster.nodeResourceGroupName | default (printf "%snodes" .Release.Name) }} + sshPublicKey: {{ $.Values.controlplane.sshPublicKey | b64enc }} + subscriptionID: {{ $.Values.subscriptionID }} + version: {{ $.Values.controlplane.kubernetes_version }} + networkPolicy: {{ $.Values.controlplane.networkPolicy }} + networkPlugin: {{ $.Values.controlplane.networkPlugin }} + networkPluginMode: {{ $.Values.controlplane.networkPluginMode }} + outboundType: {{ $.Values.controlplane.outboundType }} + dnsServiceIP: {{ $.Values.controlplane.dnsServiceIP }} + loadBalancerSKU: {{ $.Values.controlplane.loadBalancerSKU }} + aadProfile: + {{- if $.Values.controlplane.aadProfile }} + managed: {{ $.Values.controlplane.aadProfile.managed }} + adminGroupObjectIDs: + {{- range $adminGroupObjectIDs := $.Values.controlplane.aadProfile.adminGroupObjectIDs }} + - {{ $adminGroupObjectIDs }} + {{- end }} + + {{- end }} + addonProfiles: + {{- if $.Values.controlplane.aadProfile }} + {{- range $addonProfile := $.Values.controlplane.addonProfiles }} + - name: {{ $addonProfile.name }} + enabled: {{ $addonProfile.enabled }} + config: + {{- range $config := $addonProfile.config }} + {{ $config.key }}: {{ $config.value }} + {{- end }} + {{- end }} + {{- end }} + loadBalancerProfile: + {{- if $.Values.controlplane.loadBalancerProfile }} + managedOutboundIPs: {{ $.Values.controlplane.loadBalancerProfile.managedOutboundIPs }} + outboundIPs: {{ $.Values.controlplane.loadBalancerProfile.outboundIPs }} + outboundIPPrefixes: {{ $.Values.controlplane.loadBalancerProfile.outboundIPPrefixes }} + allocatedOutboundPorts: {{ $.Values.controlplane.loadBalancerProfile.allocatedOutboundPorts }} + idleTimeoutInMinutes: {{ $.Values.controlplane.loadBalancerProfile.idleTimeoutInMinutes }} + {{- end }} + apiServerAccessProfile: + {{- if $.Values.controlplane.apiServerAccessProfile }} + authorizedIPRanges: {{ $.Values.controlplane.apiServerAccessProfile.authorizedIPRanges }} + enablePrivateCluster: {{ $.Values.controlplane.apiServerAccessProfile.spec.enablePrivateCluster }} + privateDNSZone: {{ $.Values.controlplane.apiServerAccessProfile.spec.privateDNSZone }} + enablePrivateClusterPublicFQDN: {{ $.Values.controlplane.apiServerAccessProfile.spec.enablePrivateClusterPublicFQDN}} + {{- end }} + autoscalerProfile: + {{- if $.Values.controlplane.autoscalerProfile }} + balanceSimilarNodeGroups: "{{ $.Values.controlplane.autoscalerProfile.balanceSimilarNodeGroups }}" + expander: {{ $.Values.controlplane.autoscalerProfile.expander }} + maxEmptyBulkDelete: "{{ $.Values.controlplane.autoscalerProfile.maxEmptyBulkDelete }}" + maxGracefulTerminationSec: "{{ $.Values.controlplane.autoscalerProfile.maxGracefulTerminationSec }}" + maxNodeProvisionTime: "{{ $.Values.controlplane.autoscalerProfile.maxNodeProvisionTime }}" + maxTotalUnreadyPercentage: "{{ $.Values.controlplane.autoscalerProfile.maxTotalUnreadyPercentage }}" + newPodScaleUpDelay: "{{ $.Values.controlplane.autoscalerProfile.newPodScaleUpDelay }}" + okTotalUnreadyCount: "{{ $.Values.controlplane.autoscalerProfile.okTotalUnreadyCount }}" + scanInterval: "{{ $.Values.controlplane.autoscalerProfile.scanInterval }}" + scaleDownDelayAfterAdd: "{{ $.Values.controlplane.autoscalerProfile.scaleDownDelayAfterAdd }}" + scaleDownDelayAfterDelete: "{{ $.Values.controlplane.autoscalerProfile.scaleDownDelayAfterDelete }}" + scaleDownDelayAfterFailure: "{{ $.Values.controlplane.autoscalerProfile.scaleDownDelayAfterFailure }}" + scaleDownUnneededTime: "{{ $.Values.controlplane.autoscalerProfile.scaleDownUnneededTime }}" + scaleDownUnreadyTime: "{{ $.Values.controlplane.autoscalerProfile.scaleDownUnreadyTime }}" + scaleDownUtilizationThreshold: "{{ $.Values.controlplane.autoscalerProfile.scaleDownUtilizationThreshold }}" + skipNodesWithLocalStorage : "{{ $.Values.controlplane.autoscalerProfile.skipNodesWithLocalStorage }}" + skipNodesWithSystemPods: "{{ $.Values.controlplane.autoscalerProfile.skipNodesWithSystemPods }}" + {{- end }} + azureEnvironment: {{ $.Values.controlplane.azureEnvironment }} + kubeletUserAssignedIdentity: {{ $.Values.controlplane.kubeletUserAssignedIdentity }} + httpProxyConfig: + {{- if $.Values.controlplane.httpProxyConfig }} + httpProxy: {{ $.Values.controlplane.httpProxyConfig.httpProxy }} + httpsProxy: {{ $.Values.controlplane.httpProxyConfig.httpsProxy }} + noProxy: {{ $.Values.controlplane.httpProxyConfig.noProxy }} + trustedCa: {{ $.Values.controlplane.httpProxyConfig.trustedCa }} + {{- end }} + oidcIssuerProfile: {{ $.Values.controlplane.oidcIssuerProfile}} + additionalTags: + {{- range $additionalTags := $.Values.controlplane.additionalTags }} + {{ $additionalTags.key }}: {{ $additionalTags.value }} + {{- end }} + dnsPrefix : {{ $.Values.controlplane.dnsPrefix}} + fleetsMember: + {{- if $.Values.controlplane.fleetsMember }} + name: {{ $.Values.cluster.name | default .Release.Name }}-fleets + group: {{ $.Values.cluster.name | default .Release.Name }} + managerName : {{ $.Values.cluster.name | default .Release.Name }}-fleets-manager + managerResourceGroup: {{ $.Values.cluster.resourceGroupName }}-fleets + {{- end }} + sku: + tier: {{ $.Values.controlplane.sku.tier }} diff --git a/charts/azure-managed-cluster/templates/azuremanagedcluster.yaml b/charts/azure-managed-cluster/templates/azuremanagedcluster.yaml new file mode 100644 index 0000000..8b0fbba --- /dev/null +++ b/charts/azure-managed-cluster/templates/azuremanagedcluster.yaml @@ -0,0 +1,8 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedCluster +metadata: + name: {{ .Values.cluster.name | default .Release.Name }} +spec: + controlPlaneEndpoint: + host: sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint + port: 443 diff --git a/charts/azure-managed-cluster/templates/cluster.yaml b/charts/azure-managed-cluster/templates/cluster.yaml new file mode 100644 index 0000000..b20771b --- /dev/null +++ b/charts/azure-managed-cluster/templates/cluster.yaml @@ -0,0 +1,19 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + labels: + {{- include "azure-managed-cluster.labels" . | nindent 4 }} + name: {{ .Values.cluster.name | default .Release.Name }} +spec: + clusterNetwork: + services: + cidrBlocks: + {{- toYaml .Values.cluster.cidrBlocks | nindent 6 }} + controlPlaneRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedControlPlane + name: {{ .Values.cluster.name | default .Release.Name }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedCluster + name: {{ .Values.cluster.name | default .Release.Name }} diff --git a/charts/azure-managed-cluster/templates/secret.yaml b/charts/azure-managed-cluster/templates/secret.yaml new file mode 100644 index 0000000..a81cb31 --- /dev/null +++ b/charts/azure-managed-cluster/templates/secret.yaml @@ -0,0 +1,13 @@ +{{- if .Values.identity.clusterIdentitySecretValueB64 }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $.Values.identity.clusterIdentitySecretName }} + namespace: {{ $.Values.identity.clusterIdentitySecretNamespace }} + annotations: + clusterctl.cluster.x-k8s.io/move-hierarchy: "true" + helm.sh/resource-policy: keep +type: Opaque +data: + clientSecret: {{ $.Values.identity.clusterIdentitySecretValueB64 }} +{{- end }} diff --git a/charts/azure-managed-cluster/values.yaml b/charts/azure-managed-cluster/values.yaml new file mode 100644 index 0000000..aef5ff8 --- /dev/null +++ b/charts/azure-managed-cluster/values.yaml @@ -0,0 +1,143 @@ +# Default values for azure-managed-cluster. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +## AKS cluster configuration + +cluster: + ## The name of the cluster + name: '' + + ## The resource group for the AKS cluster object + resourceGroupName: '' + + ## The resource group name for the nodes + nodeResourceGroupName: '' + # nodeResourceGroupName: "{{ tpl .Values.cluster.name . }}nodes" + + ## The location of the cluster + location: eastus + + ## the subnet + cidrBlocks: + - 192.168.0.0/16 + + ## The sku of the control plane + sku: Standard + + +## The subscription ID +subscriptionID: '' +identity: + clientID: '' + tenantID: '' + clusterIdentityName: cluster-identity + clusterIdentityNamespace: default + clusterIdentitySecretName: cluster-identity-secret + clusterIdentitySecretNamespace: default + clusterIdentitySecretValueB64: '' + resourceID: "" + type: ServicePrincipal + +controlplane: + + ## SSH public key (must be valid) + + ## Kubernetes version + kubernetes_version: "v1.28.5" + + ## Network policy, "calico" (for kubenet and azurecni) or "azure" (for azureCNI) + networkPolicy: "calico" + + ## Network Plugin "kubenet" or "azure" + networkPlugin: "azure" + networkPluginMode: "overlay" + sshPublicKey: "" + outboundType: "loadBalancer" + dnsServiceIP: "" + loadBalancerSKU: "Standard" + sku: + tier: Standard + addonProfiles: + - name: azurepolicy + enabled: false + config: {} + - name: httpApplicationRouting + enabled: false + config: {} + - name: virtual-node + enabled: true + config: {} + loadBalancerProfile: + managedOutboundIPs: 1 + outboundIPs: "" + outboundIPPrefixes: "" + allocatedOutboundPorts: 0 + idleTimeoutInMinutes: 30 + apiServerAccessProfile: + authorizedIPRanges: [] + spec: + enablePrivateCluster: false + privateDNSZone: "" + enablePrivateClusterPublicFQDN: false + autoscalerProfile: + balanceSimilarNodeGroups: "false" + expander: "random" + maxEmptyBulkDelete: "10" + maxGracefulTerminationSec: "600" + maxNodeProvisionTime: "15m" + maxTotalUnreadyPercentage: "45" + newPodScaleUpDelay: "0s" + okTotalUnreadyCount: "3" + scanInterval: "10s" + scaleDownDelayAfterAdd: "10m" + scaleDownDelayAfterDelete: "0s" + scaleDownDelayAfterFailure: "3m" + scaleDownUnneededTime: "10m" + scaleDownUnreadyTime: "20m" + scaleDownUtilizationThreshold: "0.5" + skipNodesWithLocalStorage: "false" + skipNodesWithSystemPods: "false" + azureEnvironment: "AzurePublicCloud" + kubeletUserAssignedIdentity: "" + oidcIssuerProfile: "" + # disableLocalAccounts: false + additionalTags: + - key: test + value: test + dnsPrefix: "" + virtualNetwork: {} + disableLocalAccounts: false + # Only 1 Nodepool of mode System is allowed + +agentPools: [] + +defaults: + agentPool: + mode: User + # TODO: should mode be set or required? + sku: Standard_DS4_v2 + nodecount: 1 + osDiskSizeGB: 32 + availabilityZones: + - "1" + - "2" + - "3" + scaling: + minSize: 1 + maxSize: 5 + maxPods: 110 + osDiskType: "Ephemeral" + enableUltraSSD: false + osType: "Linux" + enableNodePublicIP: false + nodePublicIPPrefixID: "" + scaleSetPriority: "Regular" + scaleDownMode: "Delete" + spotMaxPrice: "" + kubeletConfig: "" + kubeletDiskType: "OS" + linuxOSConfig: "" + subnetName: "" + enableFIPS: false + enableEncryptionAtHost: false