LoginSignup
0
0

More than 1 year has passed since last update.

Kubernetes The Hard Way On VirtualBox でCSRが発行されない問題を解決

Posted at

最近kubernetesの勉強のため、Kubernetes The Hard Way On VirtualBox をやってます。
その中の、TLS Bootstrapping Worker Nodesでハマったところが2つあるので内容をまとめます。

Bootstrap Token の expiration を未来日に変える

Step 1 Create the Boostrap Token to be used by Nodes(Kubelets) to invoke Certificate API

Github 上のソースでは expiration が既に過去日になっているので、未来日に変更します。
過去日になっているとクラスターに参加できなくなります。
このことはソースのすぐ下に書いてあるんですが、見落としがちなので注意します。

master-1$ cat > bootstrap-token-07401b.yaml <<EOF
...
  # Expiration. Optional.
  expiration: 2021-03-10T03:22:11Z <- ここを未来日に
...
EOF

rotate-server-certificates オプションを追加する

Step 6 Configure Kubelet Service

次はworker-2側でkubeletのユニットファイルを作成するところで、オプションが一つ抜けているので追加します。
このオプションがなくても、worker-2はクラスターに参加できるんですが、csrが発行されないため、そのあとにmasterからkubectl logs <pod_name>を実行しても証明書エラーになります。
PRは出てるみたいなんですが、まだマージされてないです:head_bandage:

worker-2$ cat <<EOF | sudo tee /etc/systemd/system/kubelet.service
...
  --rotate-certificates=true \\
  --rotate-server-certificates=true \\ <- ここを追加
...
EOF
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0