LoginSignup
0
0

More than 3 years have passed since last update.

2021年に Kubernetes The Hard Way する

Posted at

はじめに

こんにちは、mkurokiです。
最近Kubernetesを学ぼうといろいろとやった中で、Kubernetesクラスタを自力で構築するチュートリアル Kubernetes The Hard Way をやりました。

Kubernetes The Hard Wayする という日本語での解説記事がQiitaにありましたので、そちらを参考にしつつ進めました。所々に解説が入っていて理解しやすかったです。
上記は2018年の記事ですが、現在までにKubernetes The Hard Way 本体の方にいくつか更新が入っていた箇所がありましたので、こういう差分があったよ、というところを書いてみたいと思います。

日本語記事を参考にしつつ、実行時に引っかかった方などの参考になれば幸いです。

差分

以下、章ごとに差分を書いていきます。

Prerequisites

Google Cloud Platform SDK

  • Google Cloud SDK のインストール

Google Cloud Platform SDK の項で、日本語記事では brew でのインストールとなっていましたが、Google公式のドキュメント を参考に、アーカイブをダウンロードして install することになります。

Provisioning Compute Resources

Compute Instances

  • ubuntuのバージョンとマシンタイプ

Kubernetes Controllers の項でVM作成時、ubuntuのバージョンとマシンタイプが変更になっています。
下記が変更箇所の変更後の値です。

--image-family ubuntu-2004-lts \
--machine-type e2-standard-2 \

Bootstrapping the Kubernetes Control Plane

Enable HTTP Health Checks

  • helthcheck時 sudo apt-get updateが追加

Enable HTTP Health Checks の項で
sudo apt-get install -y nginx の前に sudo apt-get update が追加されています。

The Kubernetes Frontend Load Balancer

  • ローカルマシンへ移動しておく

これはまぁ変更点ではないのと、読めばわかるとは思いますが、 The Kubernetes Frontend Load Balancer の項で、Provision a Network Load Balancer の前に、ローカルマシン(gcloud compute createしたマシン)へ移動することになります。

本体の方に

The compute instances created in this tutorial will not have permission to complete this section. Run the following commands from the same machine used to create the compute instances.

という注意書きが書いてある通り、直前の手順まではcontroller-0で作業しているのですが、ここでローカルマシンへ移動する必要があります。一応。

Bootstrapping the Kubernetes Worker Nodes

Provisioning a Kubernetes Worker Node

  • worker node の設定

Provisioning a Kubernetes Worker Node の項の最初で依存パッケージをインストールしたあとに Disable swap の手順が追加になっています。
Download and Install Worker Binaries 内の Install the worker binaries:の手順も変更になっているようです

Configure containerd

  • /etc/containerd/config.toml の内容変更

Configure containerd の項で、/etc/containerd/config.toml の内容が少し変更になっています。

Smoke Test

  • Untrusted Workloads が丸々なくなっています

そのままですが、項目ごと消えたようです。

おわりに

2021年現在の差分は(見つけられた範囲では)以上です。
Kubernetes The Hard Way はまさに「Hard」と銘打ってある通り、Kubernetesクラスタを自力で構築運用することの辛さと、GKEやEKSのありがたさを感じました。

この記事はおそらくKubernetes The Hard Way本体をそのままなぞる方には不要ですが、日本語解説もありがたかったので、そちらをベースにする方の参考になればという感じです。

それでは Hard Way へ挑戦される方は、ぜひ頑張ってください!

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