LoginSignup
0
0

Almalinux 9 にkubernetes環境を構築

Last updated at Posted at 2024-04-10

はじめに

almalinuxにkubernetesを構築することは,難しいとか無理だとかとかという記述もあるくらい,実は難しいようである.

その私も実際には幾ばくか手こずることとなったため,それを備忘録としてとどめた.

参考とする方法

以下の方法を参考にする.
How to Install and Deploy Kubernetes on AlmaLinux

しかしながら,2024/04/10現在では,このまま忠実に行うと途中でつまずくようであるため,以下の部分に注意することで何とかうまく出来るようになった.

修正箇所

その1 Step 6: Install cri-dockerd

2024/04/10現在ではdockerd CRI のバージョンが0.3.12となっている.このため,

その1-1

3.Use the wget command to download the cri-dockerd TGZ archive:

wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.1/cri-dockerd-0.3.1.amd64.tgz

の部分を

wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.12/cri-dockerd-0.3.12.amd64.tgz

と修正する.

その1-2

上記を受けて,
4. Untar the archive by typing:
については,

tar xvf cri-dockerd-0.3.1.amd64.tgz

tar xvf cri-dockerd-0.3.12.amd64.tgz

と修正する.

その2 Step 7: Install Kubernetes

ここでは,

sudo yum install -y kubelet kubeadm kubectl --disableexcludes=Kubernetes

を実行すると,kubernetes.repoの問題があってインストールが失敗する.このことから,以下のような修正を行う.

2.Copy the code below and paste it into the file.

/etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

の部分について,Facing-challanges-for-installation-of-kubernest-cluster-setup-through-kubeadm-on-rhel8.9-vm. – 404 for https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml (IP: 142.250.115.139)を参考に,

2.Copy the code below and paste it into the file.

/etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key

と修正すれば良い.

ただし,2024/04/10現在のことであるため,後日参考にする場合はv1.29で良いかどうかの確認が必要になるだろう.

おわりに

いくつか注意点はあるだろうが,almalinuxなどCentOSの流れを汲むOSでもkubernutsのインストールは出来るようである.

大切なことは,参考記事においてバージョンが含まれる事項があれば,構築時点でのバージョンが同じでようかどうか,どのように整合を取るかがひとつのポイントであると思われる.

以上

参考

[Docker, Rancher, Alma Linux 9] は動作しないというお話

How to Install and Deploy Kubernetes on AlmaLinux

Facing-challanges-for-installation-of-kubernest-cluster-setup-through-kubeadm-on-rhel8.9-vm. – 404 for https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml (IP: 142.250.115.139)

付録

もし,おうちクラウドにkubernetes環境を構築を参考にする場合は,
Kubernetesパッケージリポジトリ設定の部分において,上記「その2 Step 7: Install Kubernetes」を参考に修正を加えるとよいと思われる.

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