Skip to content

Commit

Permalink
Merge pull request #307 from AkihiroSuda/fix-299
Browse files Browse the repository at this point in the history
Avoid printing kubeadm token to the terminal
  • Loading branch information
AkihiroSuda committed Sep 17, 2023
2 parents 0747b8d + 81eb3c8 commit 3cf8d0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,18 @@ kubectl:

.PHONY: join-command
join-command:
$(NODE_SHELL) kubeadm token create --print-join-command >join-command
$(NODE_SHELL) kubeadm token create --print-join-command | tr -d '\r' >join-command
@echo "# Copy the 'join-command' file to another host, and run 'make kubeadm-join' on that host (not on this host)"

.PHONY: kubeadm-init
kubeadm-init:
$(NODE_SHELL) sh -euc "envsubst </usernetes/kubeadm-config.yaml >/tmp/kubeadm-config.yaml"
$(NODE_SHELL) kubeadm init --config /tmp/kubeadm-config.yaml
$(NODE_SHELL) kubeadm init --config /tmp/kubeadm-config.yaml --skip-token-print
@echo "# Run 'make join-command' to print the join command"

.PHONY: kubeadm-join
kubeadm-join:
$(NODE_SHELL) $(shell cat join-command)
$(NODE_SHELL) sh -euc '$$(cat /usernetes/join-command)'

.PHONY: install-flannel
install-flannel:
Expand Down

0 comments on commit 3cf8d0f

Please sign in to comment.