5
3

More than 3 years have passed since last update.

Raspberry Pi 4でおうちAmazon EKS Distro (EKS-D) をやってみた

Last updated at Posted at 2020-12-06

Re:Invent 2020でAmazon EKS Distro (EKS-D)が発表されましたね。

公式ブログはこちら
なぜか日本語の方にはEKS-Dの表記がないですね

Amazon EKS Distro: Amazon EKS で使用される Kubernetes ディストリビューション
https://aws.amazon.com/jp/blogs/news/amazon-eks-distro-the-kubernetes-distribution-used-by-amazon-eks/

Introducing Amazon EKS Distro (EKS-D)
https://aws.amazon.com/jp/blogs/opensource/introducing-amazon-eks-distro/

早速手持ちのRaspberry Pi 4でやってみました。

先にまとめ

環境

Raspberry Pi 4 (メモリ8GB)
microSDカード 32GB ※EKS-Dのビルドを行う際に10GBほど必要です

OSはUbuntu 20.04(64bit)です。

前準備

sudo apt update && sudo apt upgrade -y
  • snapcraftのインストール
sudo snap install snapcraft --classic
  • /boot/firmware/cmdline.txtcgroup_enable=memory cgroup_memory=1を追加(1行目の末尾)
- net.ifnames=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc
+ net.ifnames=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc cgroup_enable=memory cgroup_memory=1
  • LXDの初期化

ビルド時にLXDを使ってみました。初期化します。ディスクスペースが5GBでは不足するので10GBにしました。それ以外はデフォルト設定です。

sudo lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: 
Create a new ZFS pool? (yes/no) [default=yes]: 
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: 
Size in GB of the new loop device (1GB minimum) [default=5GB]: 10GB     ←ここだけ!
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
Would you like LXD to be available over the network? (yes/no) [default=no]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: 

EKS-Dのsnapパッケージのビルド

cd /tmp/
git clone https://github.com/canonical/eks-snap.git
cd eks-snap/
snapcraft --use-lxd

45分ほど待つと、eks_v1.18.9_arm64.snapが出来上がります
私のビルド成果物はこちらに格納しました。
https://github.com/moritalous/eks-snap/releases/tag/eks_v1.18.9_arm64

EKS-Dのインストール

sudo snap install eks_v1.18.9_arm64.snap --classic --dangerous

EKS-Dの起動

sudo eks.start

ステータス確認

ubuntu@ubuntu:~$ sudo eks status
eks is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
ubuntu@ubuntu:~$ 

ubuntuユーザーで動作するように設定

mkdir ~/.kube
cd ~/.kube
sudo eks.config > config
chmod 600 config
sudo usermod -a -G eks ubuntu
sudo chown -f -R ubuntu ~/.kube

一度ログアウトして再ログインすると、eks.kubectlコマンドが使えると思います。

色々確認

eksに含まれるコマンドの確認

ubuntu@ubuntu:~$ eks help
Available subcommands are:
        add-node
        config
        ctr
        dashboard-proxy
        dbctl
        join
        kubectl
        leave
        refresh-certs
        remove-node
        reset
        start
        status
        stop
        inspect
ubuntu@ubuntu:~$ 

kube-systemで起動しているPodの確認

ubuntu@ubuntueks kubectl get pods -n kube-system 
NAME                                       READY   STATUS    RESTARTS   AGE
calico-node-7js69                          1/1     Running   1          83m
metrics-server-f59887c58-5wxdp             1/1     Running   0          83m
calico-kube-controllers-555fc8cc5c-6v286   1/1     Running   0          83m
coredns-6788f546c9-vtbq5                   1/1     Running   0          83m
hostpath-provisioner-c77bfc987-vnbzk       1/1     Running   0          83m
ubuntu@ubuntu:~$

Serviceの確認

ubuntu@ubuntu:~$ eks kubectl get svc --all-namespaces 
NAMESPACE     NAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes       ClusterIP   10.152.183.1     <none>        443/TCP                  87m
kube-system   kube-dns         ClusterIP   10.152.183.10    <none>        53/UDP,53/TCP,9153/TCP   87m
kube-system   metrics-server   ClusterIP   10.152.183.182   <none>        443/TCP                  87m
ubuntu@ubuntu:~$ 

イマイチどのあたりがEKSなのか、わかりませんでした。。。

5
3
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
5
3