fix forgotten user in k3s user creation

fix hard-coded username in k3s user creation
This commit is contained in:
Niels Kunis 2024-04-13 14:00:18 +02:00
parent d40150b97a
commit 145cf2e72f

View file

@ -45,10 +45,10 @@ spec:
" "
echo Creating K8S CSR resource echo Creating K8S CSR resource
ssh "$host" "echo \"$k8s_csr\" | k3s kubectl apply -f -" ssh "root@$host" "echo \"$k8s_csr\" | k3s kubectl apply -f -"
echo Approving K8S CSR echo Approving K8S CSR
ssh "$host" "k3s kubectl certificate approve $username-csr" ssh "root@$host" "k3s kubectl certificate approve $username-csr"
echo Retrieving approved certificate echo Retrieving approved certificate
encoded_cert="$(ssh root@"$host" "k3s kubectl get csr $username-csr -o jsonpath='{.status.certificate}'")" encoded_cert="$(ssh root@"$host" "k3s kubectl get csr $username-csr -o jsonpath='{.status.certificate}'")"
@ -69,7 +69,7 @@ clusters:
contexts: contexts:
- context: - context:
cluster: default cluster: default
user: pim user: $username
name: default name: default
current-context: default current-context: default
kind: Config kind: Config