Skip to content

Commit a9460c6

Browse files
committed
fix: add explicit namespace to the template
Might be needed for other templates, but not sure. Seems not to work anymore with CAPI >= 1.9.0. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent 57fcce4 commit a9460c6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

aws/standard/standard.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Cluster-wide vars
22
export CLUSTER_NAME=talos-aws-test
3+
export NAMESPACE=default
34
export AWS_REGION=us-east-1
45
export AWS_SSH_KEY_NAME=talos-ssh
56
export AWS_VPC_ID=vpc-xxyyyzz

aws/standard/standard.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
33
kind: Cluster
44
metadata:
55
name: ${CLUSTER_NAME}
6+
namespace: ${NAMESPACE}
67
spec:
78
clusterNetwork:
89
pods:
@@ -12,15 +13,18 @@ spec:
1213
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
1314
kind: AWSCluster
1415
name: ${CLUSTER_NAME}
16+
namespace: ${NAMESPACE}
1517
controlPlaneRef:
1618
kind: TalosControlPlane
1719
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
1820
name: ${CLUSTER_NAME}-controlplane
21+
namespace: ${NAMESPACE}
1922
---
2023
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2124
kind: AWSCluster
2225
metadata:
2326
name: ${CLUSTER_NAME}
27+
namespace: ${NAMESPACE}
2428
spec:
2529
region: ${AWS_REGION}
2630
sshKeyName: ${AWS_SSH_KEY_NAME}
@@ -40,6 +44,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
4044
kind: AWSMachineTemplate
4145
metadata:
4246
name: ${CLUSTER_NAME}-controlplane
47+
namespace: ${NAMESPACE}
4348
spec:
4449
template:
4550
spec:
@@ -59,13 +64,15 @@ apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
5964
kind: TalosControlPlane
6065
metadata:
6166
name: ${CLUSTER_NAME}-controlplane
67+
namespace: ${NAMESPACE}
6268
spec:
6369
version: v${KUBERNETES_VERSION}
6470
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
6571
infrastructureTemplate:
6672
kind: AWSMachineTemplate
6773
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
6874
name: ${CLUSTER_NAME}-controlplane
75+
namespace: ${NAMESPACE}
6976
controlPlaneConfig:
7077
controlplane:
7178
generateType: controlplane
@@ -92,6 +99,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
9299
kind: TalosConfigTemplate
93100
metadata:
94101
name: ${CLUSTER_NAME}-workers
102+
namespace: ${NAMESPACE}
95103
spec:
96104
template:
97105
spec:
@@ -113,6 +121,7 @@ metadata:
113121
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
114122
nodepool: nodepool-a
115123
name: ${CLUSTER_NAME}-workers
124+
namespace: ${NAMESPACE}
116125
spec:
117126
clusterName: ${CLUSTER_NAME}
118127
replicas: ${WORKER_MACHINE_COUNT}
@@ -132,16 +141,19 @@ spec:
132141
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
133142
kind: TalosConfigTemplate
134143
name: ${CLUSTER_NAME}-workers
144+
namespace: ${NAMESPACE}
135145
infrastructureRef:
136146
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
137147
kind: AWSMachineTemplate
138148
name: ${CLUSTER_NAME}-workers
149+
namespace: ${NAMESPACE}
139150
version: ${KUBERNETES_VERSION}
140151
---
141152
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
142153
kind: AWSMachineTemplate
143154
metadata:
144155
name: ${CLUSTER_NAME}-workers
156+
namespace: ${NAMESPACE}
145157
spec:
146158
template:
147159
spec:
@@ -162,6 +174,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
162174
kind: MachineHealthCheck
163175
metadata:
164176
name: ${CLUSTER_NAME}-worker-hc
177+
namespace: ${NAMESPACE}
165178
spec:
166179
clusterName: ${CLUSTER_NAME}
167180
maxUnhealthy: 40%

0 commit comments

Comments
 (0)