From 145cf2e72f4974d3237358d94d91a3690137fe1c Mon Sep 17 00:00:00 2001 From: Niels Kunis Date: Sat, 13 Apr 2024 14:00:18 +0200 Subject: [PATCH] fix forgotten user in k3s user creation fix hard-coded username in k3s user creation --- nix/flake/scripts/gen-k3s-cert.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/flake/scripts/gen-k3s-cert.sh b/nix/flake/scripts/gen-k3s-cert.sh index 8473e31..405f9f9 100644 --- a/nix/flake/scripts/gen-k3s-cert.sh +++ b/nix/flake/scripts/gen-k3s-cert.sh @@ -45,10 +45,10 @@ spec: " 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 -ssh "$host" "k3s kubectl certificate approve $username-csr" +ssh "root@$host" "k3s kubectl certificate approve $username-csr" echo Retrieving approved certificate encoded_cert="$(ssh root@"$host" "k3s kubectl get csr $username-csr -o jsonpath='{.status.certificate}'")" @@ -69,7 +69,7 @@ clusters: contexts: - context: cluster: default - user: pim + user: $username name: default current-context: default kind: Config