Skip to content

Commit

Permalink
fix: set a correct shell variable name for node_token (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfSheol committed Jun 1, 2022
1 parent b14ed39 commit a8985b2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/tools/400_install_k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ EOF
cat <<EOF > /opt/tools/k3s/02_add_all_nodes.sh
#!/usr/bin/env bash
node-token=\$(cat /var/lib/rancher/k3s/server/node-token)
node_token=\$(cat /var/lib/rancher/k3s/server/node-token)
IPS=(${CONFIG_CLUSTER_IPS})
for host in ${CONFIG_CLUSTER_IPS}; do
ssh ${CONFIG_SYSTEM_USER}@\$host 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node-token} sh -s - server https://\${IPS[0]}:6443'
ssh ${CONFIG_SYSTEM_USER}@\$host 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node_token} sh -s - server https://\${IPS[0]}:6443'
done
exit 0
Expand All @@ -33,7 +33,7 @@ EOF
cat <<EOF > /opt/tools/k3s/021_add_node.sh
#!/usr/bin/env bash
node-token=\$(cat /var/lib/rancher/k3s/server/node-token)
node_token=\$(cat /var/lib/rancher/k3s/server/node-token)
if [[ \$# -ne 1 ]]; then
echo "./\$0 <ip>"
Expand All @@ -42,9 +42,9 @@ fi
IPS=(${CONFIG_CLUSTER_IPS})
ssh ${CONFIG_SYSTEM_USER}@\$1 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node-token} sh -s - server https://\${IPS[0]}:6443'
ssh ${CONFIG_SYSTEM_USER}@\$1 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node_token} sh -s - server https://\${IPS[0]}:6443'
# ssh ${CONFIG_SYSTEM_USER}@\$1 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node-token} K3S_URL=https://\${IPS[0]}:6443 sh -
# ssh ${CONFIG_SYSTEM_USER}@\$1 'curl -sfL https://get.k3s.io | K3S_NODE_NAME=\\\$(hostname) K3S_TOKEN=\${node_token} K3S_URL=https://\${IPS[0]}:6443 sh -
# ssh -L 9999:127.0.0.1:8001 -N pi@192.168.2.201
exit 0
Expand Down

0 comments on commit a8985b2

Please sign in to comment.