Voici la configuration pour un utilisateur basique :
apiVersion: v1 kind: ServiceAccount metadata: name: edouard namespace: kube-system
Appliquer avec la commande habituelle :
kubectl apply -f user.yaml
Définition yaml de cette association :
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: edouard roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: edouard namespace: kube-system
Appliquer avec la commande habituelle :
kubectl apply -f role.yaml
Pour voir le jeton :
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep edouard | awk '{print $1}')