Skip to content

Commit

Permalink
Merge pull request #65 from e-minguez/ssh-options
Browse files Browse the repository at this point in the history
Added ssh options to avoid confirming ssh key
  • Loading branch information
cprivitere authored Jul 19, 2023
2 parents d2247bd + 193951b commit ab14758
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ MODULENAME="demo_cluster"
IFS=$'\n'
for cluster in $(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api | keys[]"); do
IP=$(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api[\"${cluster}\"]")
ssh root@${IP} kubectl get nodes
ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${IP} kubectl get nodes
done
)

Expand All @@ -286,7 +286,7 @@ IFS=$'\n'
for cluster in $(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api | keys[]"); do
IP=$(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api[\"${cluster}\"]")
export KUBECONFIG="./$(echo ${cluster}| tr -c -s '[:alnum:]' '-')-kubeconfig"
scp root@${IP}:/etc/rancher/k3s/k3s.yaml ${KUBECONFIG}
scp -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${IP}:/etc/rancher/k3s/k3s.yaml ${KUBECONFIG}
sed -i "s/127.0.0.1/${IP}/g" ${KUBECONFIG}
chmod 600 ${KUBECONFIG}
kubectl get nodes
Expand All @@ -308,7 +308,7 @@ IFS=$'\n'
for cluster in $(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api | keys[]"); do
IP=$(terraform output -json | jq -r ".${MODULENAME}.value.k3s_api[\"${cluster}\"]")
export KUBECONFIG="./$(echo ${cluster}| tr -c -s '[:alnum:]' '-')-kubeconfig"
scp root@${IP}:/etc/rancher/k3s/k3s.yaml ${KUBECONFIG}
scp -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${IP}:/etc/rancher/k3s/k3s.yaml ${KUBECONFIG}
sed -i "" "s/127.0.0.1/${IP}/g" ${KUBECONFIG}
chmod 600 ${KUBECONFIG}
kubectl get nodes
Expand Down

0 comments on commit ab14758

Please sign in to comment.