1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
19 # TEMPLATE PARAMETERS:
22 # CLUSTER_KUSTOMIZATION_NAME: Name of the cluster in the management cluster (i.e., the `Kustomization`).
23 # CLUSTER_NAME: Name of the cluster in the target cloud. It may differ from `CLUSTER_KUSTOMIZATION_NAME` since naming restrictions are often different from K8s resource naming restrictions (e.g., hyphens vs. underscores).
24 # CLUSTER_AGE_SECRET_NAME: Name of the secret in the management cluster that keeps the private key for age/sops in the remote cluster.
26 # Creates required remote namespaces
27 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
30 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
31 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
33 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
40 - name: ${CLUSTER_KUSTOMIZATION_NAME}
41 namespace: ${CLUSTER_KUSTOMIZATION_NAMESPACE}
48 namespace: flux-system
49 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/namespaces
52 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
53 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
56 # Creates remote `flux-system.flux-system` secret
57 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
60 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-flux
61 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
63 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
70 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
77 namespace: flux-system
78 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
81 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
82 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
89 namespace: ${secret_namespace}
96 secret_name: flux-system
97 secret_namespace: flux-system
103 # Creates remote `flux-system.managed-resources` secret
104 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
107 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-managedresources-flux
108 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
110 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
117 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
124 namespace: flux-system
125 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
128 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
129 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
136 namespace: ${secret_namespace}
138 username: ${username}
139 password: ${password}
143 secret_name: flux-system
144 secret_namespace: ${BOOTSTRAP_SECRET_NAMESPACE}
150 # Creates remote `sops-age` secret
151 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
154 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-sops
155 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
157 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
164 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
171 namespace: flux-system
172 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
175 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
176 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
183 namespace: ${secret_namespace}
185 age.agekey: ${agekey}
189 secret_name: sops-age
190 secret_namespace: flux-system
193 name: ${CLUSTER_AGE_SECRET_NAME}
196 # Creates remote `fleet-repo.flux-system` secret
197 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
200 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-fleet
201 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
203 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
210 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
217 namespace: flux-system
218 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
221 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
222 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
229 namespace: ${secret_namespace}
231 username: ${username}
232 password: ${password}
236 secret_name: fleet-repo
237 secret_namespace: flux-system
243 # Creates remote `fleet-repo.managed-resources` secret
244 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
247 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-managedresources-fleet
248 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
250 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
257 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
264 namespace: flux-system
265 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
268 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
269 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
276 namespace: ${secret_namespace}
278 username: ${username}
279 password: ${password}
283 secret_name: fleet-repo
284 secret_namespace: ${BOOTSTRAP_SECRET_NAMESPACE}
290 # Creates remote `sw-catalogs.flux-system` secret
291 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
294 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-catalogs
295 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
297 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
304 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
311 namespace: flux-system
312 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
315 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
316 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
323 namespace: ${secret_namespace}
325 username: ${username}
326 password: ${password}
330 secret_name: sw-catalogs
331 secret_namespace: flux-system
337 # Creates remote `sw-catalogs.managed-resources` secret
338 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
341 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-managedresources-catalogs
342 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
344 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
351 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
358 namespace: flux-system
359 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
362 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
363 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}
370 namespace: ${secret_namespace}
372 username: ${username}
373 password: ${password}
377 secret_name: sw-catalogs
378 secret_namespace: ${BOOTSTRAP_SECRET_NAMESPACE}
384 # Remote installation of Flux controller (to let the cluster be autonomous)
385 apiVersion: kustomize.toolkit.fluxcd.io/v1
388 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-fluxctrl
389 namespace: ${BOOTSTRAP_KUSTOMIZATION_NAMESPACE}
391 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
393 # Tune interval as needed
395 path: ./clusters/${CLUSTER_KUSTOMIZATION_NAME}/flux-system
397 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-flux
398 # Avoids removing resources unexpectedly
403 namespace: flux-system
406 name: ${CLUSTER_KUBECONFIG_SECRET_NAME}
407 key: ${CLUSTER_KUBECONFIG_SECRET_KEY}