0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Kubernetes the Hard Way on Vagrant with v1.18.2

Last updated at Posted at 2020-05-04

こちらを参考にしました
https://qiita.com/t_ume/items/5d24b377e08669155639

下敷きにオリジナル版をやったうえでのチャレンジです
https://github.com/kelseyhightower/kubernetes-the-hard-way

同じことをやっても仕方ないのと、現状では v1.15.3 とバージョンが古いのもあるので、導入するソフトウェアバージョンを現状の最新にしてみました。

  • Ubuntu 18.04.4 LTS (Both host and all VirtualBox VMs)
  • VirtuarBox v6.1.6
  • Vagrant 2.2.7
  • Kubernetes: v1.18.2
  • Containerd: 1.3.4
  • runc: v1.0.0-rc10
  • etcd: v3.4.7

成果物は以下に置きました。
https://github.com/dmiyakawa/kube-the-hard-way-on-vagrant

VMのイメージ類やインストラクションはないです。インストラクションは上の記事を踏襲すれば概ねOKですが、ちょっと設定ファイルには違いがあったので2点指摘しておきます

  • kube-apiserver.service should have --runtime-config=api/all=true instead of --runtime-config=api/all for its boot option
  • kube-controller-manager.service should have --master=http://localhost:8080 in adittion.

これらの対応がないと Control Plane を構築する段階でちょっと分かりづらいエラーが出ます。ちなみに上の方法が「正しい」かまではわかりませんが、一応スモークテストは通っています。
変更を適用済のsystemdの設定ファイルも上のレポにあるので、比較すると良いかもしれません。

オリジナル版が手元のGCP請求から逆算するに2〜3時間で終わっていて、体感でも非常にわかりやすかったことと比較すると、on Vagrantは結構作業ミスや上記のようなトラブルシューティングが多くて大変だったなぁという印象でした。

特にエラーがストレートに症状を説明しない。こういう感じでログにエラーが出てくるんですね。

May 03 22:38:12 controller-0 kube-controller-manager[25440]: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
May 03 22:38:12 controller-0 systemd[1]: kube-controller-manager.service: Main process exited, code=exited, status=1/FAILURE
May 03 22:38:12 controller-0 systemd[1]: kube-controller-manager.service: Failed with result 'exit-code'.

この no configuration has been provided, try setting KUBERNETES_MASTER environment variable というエラー自体は kubectl における v1.18.2 の変更に基づくものらしく、それ自体はIssueもすぐ見つかるんですが、では、それがなぜ kube-controller-manager のログで出てくるのか、ということまでは初心者にはちょっと分かりづらいですね。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?