Skip to content

Commit 98bde89

Browse files
committed
Add README and fix resource group name default
1 parent 47fe03f commit 98bde89

File tree

5 files changed

+80
-30
lines changed

5 files changed

+80
-30
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Cluster API Provider Azure Managed Cluster Helm Chart
2+
3+
This Helm chart is used to deploy a CAPZ Managed Cluster to a Cluster API Management Cluster.
4+
5+
## 1. Prerequisites
6+
7+
Create a Kubernetes cluster with a resource like kind and install the Cluster API Provider Azure (CAPZ) components with
8+
9+
```bash
10+
clusterctl init --infrastructure azure
11+
```
12+
13+
## 2. Add the repo for the CAPZ Managed Cluster Helm Chart
14+
15+
```bash
16+
helm repo add capi https://mboersma.github.io/cluster-api-charts
17+
```
18+
## 3. Specify values for the CAPZ Managed Cluster Helm Chart
19+
20+
Create a `values.yaml` to specify credentials and other values for the CAPZ Managed Cluster Helm Chart. It can look like the following:
21+
22+
```yaml
23+
subscriptionID: <subscription-id>
24+
identity:
25+
clientID: <client-id>
26+
tenantID: <tenant-id>
27+
type: WorkloadIdentity
28+
cluster:
29+
location: eastus
30+
cidrBlocks:
31+
- 192.168.0.0/16
32+
controlplane:
33+
sshPublicKey: <ssh-public-key>
34+
networkPolicy: "calico"
35+
networkPlugin: "kubenet"
36+
networkPluginMode: null
37+
38+
```
39+
40+
## 4. Install the CAPZ Managed Cluster Helm Chart
41+
42+
```bash
43+
helm install <name> capi/azure-managed-cluster -f values.yaml
44+
```
45+
46+
## 5. Uninstall the CAPZ Managed Cluster Helm Chart
47+
48+
```bash
49+
helm uninstall <name>
50+
```
51+
52+
Note: Uninstall currently is bugged.
53+
54+
Note: the AzureClusterIdentity and cluster identity secret are not deleted when the chart is uninstalled.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
{{- if not (lookup "infrastructure.cluster.x-k8s.io/v1beta1" "AzureClusterIdentity" .Values.identity.clusterIdentityNamespace .Values.identity.clusterIdentityName) }}
1+
{{- if not (lookup "infrastructure.cluster.x-k8s.io/v1beta1" "AzureClusterIdentity" .Release.Namespace .Values.identity.clusterIdentityName) }}
22
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
33
kind: AzureClusterIdentity
44
metadata:
55
labels:
66
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
77
annotations:
88
helm.sh/resource-policy: keep
9-
name: {{ $.Values.identity.clusterIdentityName }}
9+
name: {{ .Values.identity.clusterIdentityName }}
1010
spec:
1111
allowedNamespaces:
1212
list:
13-
- {{ $.Values.identity.clusterIdentitySecretNamespace }}
13+
- {{ .Release.Namespace }}
1414
clientSecret:
15-
name: {{ $.Values.identity.clusterIdentitySecretName }}
16-
namespace: {{ $.Values.identity.clusterIdentitySecretNamespace }}
17-
clientID: {{ $.Values.identity.clientID }}
18-
tenantID: {{ $.Values.identity.tenantID }}
19-
type: {{ $.Values.identity.type }}
20-
resourceID: {{ $.Values.identity.resourceID }}
21-
{{- end }}
15+
name: {{ .Values.identity.clusterIdentitySecretName }}
16+
namespace: {{ .Release.Namespace }}
17+
clientID: {{ .Values.identity.clientID }}
18+
tenantID: {{ .Values.identity.tenantID }}
19+
type: {{ .Values.identity.type }}
20+
resourceID: {{ .Values.identity.resourceID }}
21+
{{- end }}

charts/azure-managed-cluster/templates/azuremanagedccontrolplane.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
kind: AzureClusterIdentity
99
name: {{ $.Values.identity.clusterIdentityName }}
1010
location: {{ $.Values.cluster.location }}
11-
resourceGroupName: {{ $.Values.cluster.resourceGroupName }}
11+
resourceGroupName: {{ $.Values.cluster.resourceGroupName | default .Release.Name }}
1212
nodeResourceGroupName: {{ $.Values.cluster.nodeResourceGroupName | default (printf "%snodes" .Release.Name) }}
1313
sshPublicKey: {{ $.Values.controlplane.sshPublicKey | b64enc }}
1414
subscriptionID: {{ $.Values.subscriptionID }}
@@ -94,7 +94,7 @@ spec:
9494
name: {{ $.Values.cluster.name | default .Release.Name }}-fleets
9595
group: {{ $.Values.cluster.name | default .Release.Name }}
9696
managerName : {{ $.Values.cluster.name | default .Release.Name }}-fleets-manager
97-
managerResourceGroup: {{ $.Values.cluster.resourceGroupName }}-fleets
97+
managerResourceGroup: {{ $.Values.cluster.resourceGroupName | default .Release.Name }}-fleets
9898
{{- end }}
9999
sku:
100100
tier: {{ $.Values.controlplane.sku.tier }}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
{{- if .Values.identity.clusterIdentitySecretValueB64 }}
1+
{{- if .Values.identity.clusterIdentitySecretValue }}
2+
{{- if not (lookup "v1" "Secret" .Release.Namespace .Values.identity.clusterIdentitySecretName) }}
23
apiVersion: v1
34
kind: Secret
45
metadata:
5-
name: {{ $.Values.identity.clusterIdentitySecretName }}
6-
namespace: {{ $.Values.identity.clusterIdentitySecretNamespace }}
6+
name: {{ .Values.identity.clusterIdentitySecretName }}
77
annotations:
88
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
99
helm.sh/resource-policy: keep
1010
type: Opaque
1111
data:
12-
clientSecret: {{ $.Values.identity.clusterIdentitySecretValueB64 }}
12+
clientSecret: {{ .Values.identity.clusterIdentitySecretValue | b64enc}}
13+
{{- end }}
1314
{{- end }}

charts/azure-managed-cluster/values.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66

77
cluster:
88
## The name of the cluster
9-
name: ''
9+
name: ""
1010

1111
## The resource group for the AKS cluster object
12-
resourceGroupName: ''
12+
resourceGroupName: ""
1313

1414
## The resource group name for the nodes
15-
nodeResourceGroupName: ''
16-
# nodeResourceGroupName: "{{ tpl .Values.cluster.name . }}nodes"
15+
nodeResourceGroupName: ""
1716

1817
## The location of the cluster
1918
location: eastus
@@ -27,15 +26,13 @@ cluster:
2726

2827

2928
## The subscription ID
30-
subscriptionID: ''
29+
subscriptionID: ""
3130
identity:
32-
clientID: ''
33-
tenantID: ''
31+
clientID: ""
32+
tenantID: ""
3433
clusterIdentityName: cluster-identity
35-
clusterIdentityNamespace: default
3634
clusterIdentitySecretName: cluster-identity-secret
37-
clusterIdentitySecretNamespace: default
38-
clusterIdentitySecretValueB64: ''
35+
clusterIdentitySecretValue: ""
3936
resourceID: ""
4037
type: ServicePrincipal
4138

@@ -44,7 +41,7 @@ controlplane:
4441
## SSH public key (must be valid)
4542

4643
## Kubernetes version
47-
kubernetes_version: "v1.28.5"
44+
kubernetes_version: "v1.28.9"
4845

4946
## Network policy, "calico" (for kubenet and azurecni) or "azure" (for azureCNI)
5047
networkPolicy: "calico"
@@ -101,21 +98,19 @@ controlplane:
10198
azureEnvironment: "AzurePublicCloud"
10299
kubeletUserAssignedIdentity: ""
103100
oidcIssuerProfile: ""
104-
# disableLocalAccounts: false
105101
additionalTags:
106102
- key: test
107103
value: test
108104
dnsPrefix: ""
109105
virtualNetwork: {}
110106
disableLocalAccounts: false
111-
# Only 1 Nodepool of mode System is allowed
112107

113108
agentPools: []
114109

115110
defaults:
116111
agentPool:
117112
mode: User
118-
# TODO: should mode be set or required?
113+
# Note: Only 1 Nodepool of mode System is allowed so we default to User.
119114
sku: Standard_DS4_v2
120115
nodecount: 1
121116
osDiskSizeGB: 32

0 commit comments

Comments
 (0)