From e3b18e6f1b399b1129f7d3f4f4d43e72888d6328 Mon Sep 17 00:00:00 2001 From: Diego LAA Date: Thu, 1 Jun 2023 10:09:31 -0500 Subject: [PATCH] chore: Add NSP gitops with sa customization (#296) Signed-off-by: Diego Alfonso --- .../gitops-install-params-sa/desired-namespaces.yaml | 10 ++++++++++ .../gitops-install-params-sa/namespaces.yaml | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ns-provisioner-samples/gitops-install-params-sa/desired-namespaces.yaml create mode 100644 ns-provisioner-samples/gitops-install-params-sa/namespaces.yaml diff --git a/ns-provisioner-samples/gitops-install-params-sa/desired-namespaces.yaml b/ns-provisioner-samples/gitops-install-params-sa/desired-namespaces.yaml new file mode 100644 index 000000000..9db2e9f7f --- /dev/null +++ b/ns-provisioner-samples/gitops-install-params-sa/desired-namespaces.yaml @@ -0,0 +1,10 @@ +#@data/values +--- +namespaces: +#! The only required parameter is the name of the namespace. All additional values provided here +#! for a namespace will be available under data.values for templating additional sources +- name: dev + supply_chain_service_account: + secrets: + - git +- name: qa \ No newline at end of file diff --git a/ns-provisioner-samples/gitops-install-params-sa/namespaces.yaml b/ns-provisioner-samples/gitops-install-params-sa/namespaces.yaml new file mode 100644 index 000000000..7a6c89b27 --- /dev/null +++ b/ns-provisioner-samples/gitops-install-params-sa/namespaces.yaml @@ -0,0 +1,11 @@ +#@ load("@ytt:data", "data") +#! This for loop will loop over the namespace list in desired-namespaces.yaml and will create those namespaces. +#! NOTE: if you have another tool like Tanzu Mission Control or some other process that is taking care of creating namespaces for you, +#! and you don’t want namespace provisioner to create the namespaces, you can delete this file from your GitOps install repository. +#@ for ns in data.values.namespaces: +--- +apiVersion: v1 +kind: Namespace +metadata: + name: #@ ns.name +#@ end