Skip to content

Commit cd6d1ca

Browse files
authored
Merge pull request #739 from prankul88/add-ns-template
🐛 Add NAMESPACE variable in cluster templates.
2 parents 8a30dec + ac856a9 commit cd6d1ca

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

templates/cluster-template-external-cloud-provider.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
33
kind: Cluster
44
metadata:
55
name: ${CLUSTER_NAME}
6+
namespace: '${NAMESPACE}'
67
spec:
78
clusterNetwork:
89
pods:
@@ -21,6 +22,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
2122
kind: OpenStackCluster
2223
metadata:
2324
name: ${CLUSTER_NAME}
25+
namespace: '${NAMESPACE}'
2426
spec:
2527
cloudName: ${OPENSTACK_CLOUD}
2628
cloudsSecret:
@@ -38,6 +40,7 @@ kind: KubeadmControlPlane
3840
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
3941
metadata:
4042
name: "${CLUSTER_NAME}-control-plane"
43+
namespace: '${NAMESPACE}'
4144
spec:
4245
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
4346
infrastructureTemplate:
@@ -69,6 +72,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
6972
kind: OpenStackMachineTemplate
7073
metadata:
7174
name: ${CLUSTER_NAME}-control-plane
75+
namespace: '${NAMESPACE}'
7276
spec:
7377
template:
7478
spec:
@@ -84,6 +88,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
8488
kind: MachineDeployment
8589
metadata:
8690
name: "${CLUSTER_NAME}-md-0"
91+
namespace: '${NAMESPACE}'
8792
spec:
8893
clusterName: "${CLUSTER_NAME}"
8994
replicas: ${WORKER_MACHINE_COUNT}
@@ -108,6 +113,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
108113
kind: OpenStackMachineTemplate
109114
metadata:
110115
name: ${CLUSTER_NAME}-md-0
116+
namespace: '${NAMESPACE}'
111117
spec:
112118
template:
113119
spec:
@@ -123,6 +129,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
123129
kind: KubeadmConfigTemplate
124130
metadata:
125131
name: ${CLUSTER_NAME}-md-0
132+
namespace: '${NAMESPACE}'
126133
spec:
127134
template:
128135
spec:
@@ -138,6 +145,7 @@ metadata:
138145
name: ${CLUSTER_NAME}-cloud-config
139146
labels:
140147
clusterctl.cluster.x-k8s.io/move: "true"
148+
namespace: '${NAMESPACE}'
141149
data:
142150
clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64}
143151
cacert: ${OPENSTACK_CLOUD_CACERT_B64}

templates/cluster-template-without-lb.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
33
kind: Cluster
44
metadata:
55
name: ${CLUSTER_NAME}
6+
namespace: '${NAMESPACE}'
67
spec:
78
clusterNetwork:
89
pods:
@@ -21,6 +22,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
2122
kind: OpenStackCluster
2223
metadata:
2324
name: ${CLUSTER_NAME}
25+
namespace: '${NAMESPACE}'
2426
spec:
2527
cloudName: ${OPENSTACK_CLOUD}
2628
cloudsSecret:
@@ -37,6 +39,7 @@ kind: KubeadmControlPlane
3739
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
3840
metadata:
3941
name: "${CLUSTER_NAME}-control-plane"
42+
namespace: '${NAMESPACE}'
4043
spec:
4144
replicas: 1
4245
infrastructureTemplate:
@@ -97,6 +100,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
97100
kind: OpenStackMachineTemplate
98101
metadata:
99102
name: ${CLUSTER_NAME}-control-plane
103+
namespace: '${NAMESPACE}'
100104
spec:
101105
template:
102106
spec:
@@ -112,6 +116,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
112116
kind: MachineDeployment
113117
metadata:
114118
name: "${CLUSTER_NAME}-md-0"
119+
namespace: '${NAMESPACE}'
115120
spec:
116121
clusterName: "${CLUSTER_NAME}"
117122
replicas: ${WORKER_MACHINE_COUNT}
@@ -136,6 +141,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
136141
kind: OpenStackMachineTemplate
137142
metadata:
138143
name: ${CLUSTER_NAME}-md-0
144+
namespace: '${NAMESPACE}'
139145
spec:
140146
template:
141147
spec:
@@ -151,6 +157,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
151157
kind: KubeadmConfigTemplate
152158
metadata:
153159
name: ${CLUSTER_NAME}-md-0
160+
namespace: '${NAMESPACE}'
154161
spec:
155162
template:
156163
spec:
@@ -178,6 +185,7 @@ metadata:
178185
name: ${CLUSTER_NAME}-cloud-config
179186
labels:
180187
clusterctl.cluster.x-k8s.io/move: "true"
188+
namespace: '${NAMESPACE}'
181189
data:
182190
clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64}
183191
cacert: ${OPENSTACK_CLOUD_CACERT_B64}

templates/cluster-template.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
33
kind: Cluster
44
metadata:
55
name: ${CLUSTER_NAME}
6+
namespace: '${NAMESPACE}'
67
spec:
78
clusterNetwork:
89
pods:
@@ -21,6 +22,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
2122
kind: OpenStackCluster
2223
metadata:
2324
name: ${CLUSTER_NAME}
25+
namespace: '${NAMESPACE}'
2426
spec:
2527
cloudName: ${OPENSTACK_CLOUD}
2628
cloudsSecret:
@@ -38,6 +40,7 @@ kind: KubeadmControlPlane
3840
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
3941
metadata:
4042
name: "${CLUSTER_NAME}-control-plane"
43+
namespace: '${NAMESPACE}'
4144
spec:
4245
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
4346
infrastructureTemplate:
@@ -98,6 +101,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
98101
kind: OpenStackMachineTemplate
99102
metadata:
100103
name: ${CLUSTER_NAME}-control-plane
104+
namespace: '${NAMESPACE}'
101105
spec:
102106
template:
103107
spec:
@@ -113,6 +117,7 @@ apiVersion: cluster.x-k8s.io/v1alpha3
113117
kind: MachineDeployment
114118
metadata:
115119
name: "${CLUSTER_NAME}-md-0"
120+
namespace: '${NAMESPACE}'
116121
spec:
117122
clusterName: "${CLUSTER_NAME}"
118123
replicas: ${WORKER_MACHINE_COUNT}
@@ -137,6 +142,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
137142
kind: OpenStackMachineTemplate
138143
metadata:
139144
name: ${CLUSTER_NAME}-md-0
145+
namespace: '${NAMESPACE}'
140146
spec:
141147
template:
142148
spec:
@@ -152,6 +158,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
152158
kind: KubeadmConfigTemplate
153159
metadata:
154160
name: ${CLUSTER_NAME}-md-0
161+
namespace: '${NAMESPACE}'
155162
spec:
156163
template:
157164
spec:
@@ -179,6 +186,7 @@ metadata:
179186
name: ${CLUSTER_NAME}-cloud-config
180187
labels:
181188
clusterctl.cluster.x-k8s.io/move: "true"
189+
namespace: '${NAMESPACE}'
182190
data:
183191
clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64}
184192
cacert: ${OPENSTACK_CLOUD_CACERT_B64}

0 commit comments

Comments
 (0)