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: managed-resources
33 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
40 - name: ${CLUSTER_KUSTOMIZATION_NAME}
47 namespace: flux-system
48 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/namespaces
51 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}
55 # Creates remote `flux-system.flux-system` secret
56 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
59 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-flux
60 namespace: managed-resources
62 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
69 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
76 namespace: flux-system
77 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
80 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}
88 namespace: ${secret_namespace}
95 secret_name: flux-system
96 secret_namespace: flux-system
102 # Creates remote `sops-age` secret
103 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
106 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-sops
107 namespace: managed-resources
109 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
116 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
123 namespace: flux-system
124 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
127 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}
135 namespace: ${secret_namespace}
137 age.agekey: ${agekey}
141 secret_name: sops-age
142 secret_namespace: flux-system
145 name: ${CLUSTER_AGE_SECRET_NAME}
148 # Creates remote `fleet-repo.flux-system` secret
149 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
152 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-fleet
153 namespace: managed-resources
155 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
162 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
169 namespace: flux-system
170 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
173 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}
181 namespace: ${secret_namespace}
183 username: ${username}
184 password: ${password}
188 secret_name: fleet-repo
189 secret_namespace: flux-system
195 # Creates remote `sw-catalogs.flux-system` secret
196 apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
199 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-catalogs
200 namespace: managed-resources
202 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
209 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-ns
216 namespace: flux-system
217 path: ./cloud-resources/flux-remote-bootstrap/bootstrap/manifests/secret
220 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}
228 namespace: ${secret_namespace}
230 username: ${username}
231 password: ${password}
235 secret_name: sw-catalogs
236 secret_namespace: flux-system
242 # Remote installation of Flux controller (to let the cluster be autonomous)
243 apiVersion: kustomize.toolkit.fluxcd.io/v1
246 name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-fluxctrl
247 namespace: managed-resources
249 cluster: ${CLUSTER_KUSTOMIZATION_NAME}
251 # Tune interval as needed
253 path: ./clusters/${CLUSTER_KUSTOMIZATION_NAME}/flux-system
255 - name: ${CLUSTER_KUSTOMIZATION_NAME}-bstrp-secret-flux
256 # Avoids removing resources unexpectedly
261 namespace: flux-system
264 name: kubeconfig-${CLUSTER_KUSTOMIZATION_NAME}