Migrate the role to a separate repo

This commit is contained in:
Nikolai Rodionov
2023-03-11 18:18:57 +01:00
commit 44bce4b274
9 changed files with 297 additions and 0 deletions

19
templates/config.j2 Normal file
View File

@ -0,0 +1,19 @@
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: {{ kubernetes_cad }}
server: {{ kubernetes_server }}
name: {{ cluster }}
contexts:
- context:
cluster: {{ cluster }}
user: {{ username }}
name: {{ username }}@{{ cluster }}
current-context: {{ username }}@{{ cluster }}
kind: Config
preferences: {}
users:
- name: {{ username }}
user:
client-certificate-data: {{ user_cert_data }}
client-key-data: {{ user_key_data }}

13
templates/role-binding.j2 Normal file
View File

@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ binding_type}}
metadata:
name: {{ username }}
namespace: {{ k8s_namespace | default("default") }}
subjects:
- kind: User
name: {{ username }}
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: {{ role_type }}
name: {{ role }}
apiGroup: rbac.authorization.k8s.io