Current Situation:
Desired Outcome:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: namespaces-role
rules:
- apiGroups: ['']
resources: ['namespaces']
verbs: ['get', 'list']
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dscp-namespaces-rolebinding-sp1-ns
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: namespaces-role
subjects:
- kind: Group
apiGroup: rbac.authorization.k8s.io
name: <objectid>
#@ 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:
annotations: ##★
apps.tanzu.vmware.com/tap-managed-ns: "" ##★
name: #@ ns.name
#@ end