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