Skip to content

Commit 1b2ace7

Browse files
committed
add aks multi tenancy flavor
1 parent 3451e3f commit 1b2ace7

File tree

4 files changed

+146
-0
lines changed

4 files changed

+146
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
apiVersion: cluster.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
metadata:
4+
name: ${CLUSTER_NAME}
5+
namespace: default
6+
spec:
7+
clusterNetwork:
8+
services:
9+
cidrBlocks:
10+
- 192.168.0.0/16
11+
controlPlaneRef:
12+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
13+
kind: AzureManagedControlPlane
14+
name: ${CLUSTER_NAME}
15+
infrastructureRef:
16+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
17+
kind: AzureManagedCluster
18+
name: ${CLUSTER_NAME}
19+
---
20+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
21+
kind: AzureManagedControlPlane
22+
metadata:
23+
name: ${CLUSTER_NAME}
24+
namespace: default
25+
spec:
26+
defaultPoolRef:
27+
name: agentpool0
28+
identityRef:
29+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
30+
kind: AzureClusterIdentity
31+
name: ${CLUSTER_IDENTITY_NAME}
32+
namespace: ${CLUSTER_IDENTITY_NAMESPACE}
33+
location: ${AZURE_LOCATION}
34+
resourceGroupName: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
35+
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
36+
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
37+
version: ${KUBERNETES_VERSION}
38+
---
39+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
40+
kind: AzureManagedCluster
41+
metadata:
42+
name: ${CLUSTER_NAME}
43+
namespace: default
44+
---
45+
apiVersion: cluster.x-k8s.io/v1alpha4
46+
kind: MachinePool
47+
metadata:
48+
name: agentpool0
49+
namespace: default
50+
spec:
51+
clusterName: ${CLUSTER_NAME}
52+
replicas: ${WORKER_MACHINE_COUNT}
53+
template:
54+
metadata: {}
55+
spec:
56+
bootstrap:
57+
dataSecretName: ""
58+
clusterName: ${CLUSTER_NAME}
59+
infrastructureRef:
60+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
61+
kind: AzureManagedMachinePool
62+
name: agentpool0
63+
namespace: default
64+
version: ${KUBERNETES_VERSION}
65+
---
66+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
67+
kind: AzureManagedMachinePool
68+
metadata:
69+
name: agentpool0
70+
namespace: default
71+
spec:
72+
osDiskSizeGB: 512
73+
sku: ${AZURE_NODE_MACHINE_TYPE}
74+
---
75+
apiVersion: cluster.x-k8s.io/v1alpha4
76+
kind: MachinePool
77+
metadata:
78+
name: agentpool1
79+
namespace: default
80+
spec:
81+
clusterName: ${CLUSTER_NAME}
82+
replicas: ${WORKER_MACHINE_COUNT}
83+
template:
84+
metadata: {}
85+
spec:
86+
bootstrap:
87+
dataSecretName: ""
88+
clusterName: ${CLUSTER_NAME}
89+
infrastructureRef:
90+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
91+
kind: AzureManagedMachinePool
92+
name: agentpool1
93+
namespace: default
94+
version: ${KUBERNETES_VERSION}
95+
---
96+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
97+
kind: AzureManagedMachinePool
98+
metadata:
99+
name: agentpool1
100+
namespace: default
101+
spec:
102+
osDiskSizeGB: 1024
103+
sku: ${AZURE_NODE_MACHINE_TYPE}
104+
---
105+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
106+
kind: AzureClusterIdentity
107+
metadata:
108+
name: ${CLUSTER_IDENTITY_NAME}
109+
namespace: default
110+
spec:
111+
allowedNamespaces: {}
112+
clientID: ${AZURE_CLUSTER_IDENTITY_CLIENT_ID}
113+
clientSecret:
114+
name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME}
115+
namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}
116+
tenantID: ${AZURE_TENANT_ID}
117+
type: ServicePrincipal
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
3+
kind: AzureClusterIdentity
4+
metadata:
5+
name: "${CLUSTER_IDENTITY_NAME}"
6+
spec:
7+
type: ServicePrincipal
8+
allowedNamespaces: {}
9+
tenantID: "${AZURE_TENANT_ID}"
10+
clientID: "${AZURE_CLUSTER_IDENTITY_CLIENT_ID}"
11+
clientSecret: {"name":"${AZURE_CLUSTER_IDENTITY_SECRET_NAME}","namespace":"${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}"}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace: default
2+
resources:
3+
- ../aks
4+
- azure-cluster-identity.yaml
5+
patchesStrategicMerge:
6+
- patches/azurecluster-identity-ref.yaml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
3+
kind: AzureManagedControlPlane
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
spec:
7+
identityRef:
8+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
9+
kind: AzureClusterIdentity
10+
name: "${CLUSTER_IDENTITY_NAME}"
11+
namespace: "${CLUSTER_IDENTITY_NAMESPACE}"
12+

0 commit comments

Comments
 (0)