diff --git a/dev/scripts/common.sh b/dev/scripts/common.sh index 91b1e78d45..700790fb1d 100644 --- a/dev/scripts/common.sh +++ b/dev/scripts/common.sh @@ -89,7 +89,7 @@ function ec_exec() { # Patches a component deployment in the embedded cluster function ec_patch() { ec_render dev/patches/$1-up.yaml > dev/patches/$1-up-ec.yaml.tmp - ec_exec k0s kubectl patch deployment $(deployment $1) -n kotsadm --patch-file dev/patches/$1-up-ec.yaml.tmp + ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf patch deployment $(deployment $1) -n kotsadm --patch-file dev/patches/$1-up-ec.yaml.tmp rm dev/patches/$1-up-ec.yaml.tmp } @@ -118,5 +118,5 @@ function up() { } function ec_up() { - ec_exec k0s kubectl exec -it deployment/$(deployment $1) -n kotsadm -- bash + ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf exec -it deployment/$(deployment $1) -n kotsadm -- bash } diff --git a/dev/scripts/down-ec.sh b/dev/scripts/down-ec.sh index 82e6f81ad8..ec6373ab57 100755 --- a/dev/scripts/down-ec.sh +++ b/dev/scripts/down-ec.sh @@ -21,8 +21,8 @@ fi echo "Reverting..." if [ "$component" == "kotsadm" ]; then - ec_exec k0s kubectl delete -f dev/manifests/kotsadm-web -n kotsadm + ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf delete -f dev/manifests/kotsadm-web -n kotsadm fi -ec_exec k0s kubectl replace -f dev/patches/$component-down-ec.yaml.tmp --force +ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf replace -f dev/patches/$component-down-ec.yaml.tmp --force ec_exec rm dev/patches/$component-down-ec.yaml.tmp diff --git a/dev/scripts/up-ec.sh b/dev/scripts/up-ec.sh index 5f8c6c8473..dfdb165127 100755 --- a/dev/scripts/up-ec.sh +++ b/dev/scripts/up-ec.sh @@ -26,20 +26,20 @@ ec_build_and_load "$component" # we can achieve a faster dev experience with hot reloading. if [ "$component" == "kotsadm" ]; then ec_build_and_load "kotsadm-web" - ec_exec k0s kubectl apply -f dev/manifests/kotsadm-web -n kotsadm + ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf apply -f dev/manifests/kotsadm-web -n kotsadm ec_patch "kotsadm-web" fi # Save original state if [ ! -f "dev/patches/$component-down-ec.yaml.tmp" ]; then - ec_exec k0s kubectl get deployment $(deployment $component) -n kotsadm -oyaml > dev/patches/$component-down-ec.yaml.tmp + ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf get deployment $(deployment $component) -n kotsadm -oyaml > dev/patches/$component-down-ec.yaml.tmp fi # Patch the deployment ec_patch $component # Wait for rollout to complete -ec_exec k0s kubectl rollout status deployment/$(deployment $component) -n kotsadm +ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf rollout status deployment/$(deployment $component) -n kotsadm # Up into the updated deployment ec_up $component