0
1

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 1 year has passed since last update.

おうちkubernetes構築記② Kubernetesのインストール

Last updated at Posted at 2022-06-06

おうちkubernetesの構築した記録全3回のうちの2回目となります。

※この内容は、masterノード / workerノード双方とも同じ処理を行います。

環境

S/W

  • OS     : Ubuntu22.04
  • docker    : 20.10.12
  • kubernetes  : 1.24.1
  • terterm    :4.106

H/W

  • 本体     :rasberry Pi4 8GB × 2
  • ルータ    :LINKSYS 5PORT
  • SDカード   :64GB

1. kubernetesのインストール

本項目は、masterノード / workerノード共通の処理となります。

  • kubernetesをubuntuにイストールする。

1)以下のコマンドを実行し、super userに切り替える。 

$ sudo -s

2)super userに切り替わったら、以下のコマンドを実行し、googleのGPGキーを取得する。

$ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add

3)OKが表示されたことを確認する。
image.png

  1. 以下のコマンドを実行し、swapを削除する。
$ swapoff -a

4)以下のコマンドを実行し、Kubernetesのリポジトリを追加します。

$ apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
  1. 以下のコマンドを実行し、パッケージリストを更新する。
$ sudo apt-get update

6)以下のコマンドを実行し、kubelet、kubeadm、kubectlをインストールする。

$ sudo apt install -y kubelet kubeadm kubectl
  1. 以下のような内容が表示されたら、正常にインストールされたことになります。
conntrack (1:1.4.6-2build2) を設定しています ...
kubectl (1.24.1-00) を設定しています ...
ebtables (2.0.11-4build2) を設定しています ...
socat (1.7.4.1-3ubuntu4) を設定しています ...
cri-tools (1.24.0-00) を設定しています ...
kubernetes-cni (0.8.7-00) を設定しています ...
ethtool (1:5.16-1) を設定しています ...
kubelet (1.24.1-00) を設定しています ...
Created symlink /etc/systemd/system/multi-user.target.wants/kubelet.service → /lib/systemd/system/kubelet.service.
kubeadm (1.24.1-00) を設定しています ...
man-db (2.10.2-1) のトリガを処理しています ...
$

以上で、Kubernetesのインストール作業は完了となります。
次回は、masterノード / workerノードそれぞれの設定と動作確認を記載します。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?