Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

第178回 雲勉 Amazon EKSをオンプレで! Amazon EKS Anywhere ...

第178回 雲勉 Amazon EKSをオンプレで! Amazon EKS Anywhere 実践構築ガイド

下記、勉強会での資料です。
https://youtu.be/wp1VyjeQziI

Avatar for iret.kumoben

iret.kumoben

December 08, 2025
Tweet

More Decks by iret.kumoben

Other Decks in Technology

Transcript

  1. 講師自己紹介 大嵩 洋喜(おおたけ ひろき) • 所属 クラウドインテグレーション事業部 • 業務と経歴 新卒として

    2023年 4月 入社 AWSのインフラ構築・監視運用保守を担当 ANGEL Dojo 2025 頂上決戦に登壇 • 認定 2025 Japan All AWS Certifications Engineers • ご質問は YouTubeのコメント欄で受け付けております。 後日回答させていただきます! @rockyx0609
  2. アジェンダ 1. Kubernetesとは 2. Amazon EKS Anywhere とは 3. 今回の構成

    4. Dockerプロバイダーの構築 5. クラスターを作成する 6. アクセスを確認する 7. 個人制作のアプリをデプロイして、外部からアクセスしてみる 8. クラスタ作成時に問題発生・・・ 9. まとめ 3
  3. 1.Kubernetesとは 5 • コンテナで動作するアプリケーションを管理するためのプラットフォーム • コンテナオーケストレーションにおけるデファクトスタンダート • Googleが開発し、現在はCloud Native Computing

    Foundation(CNCF)が管理 ・第105回 雲勉【オンライン】Amazon EKSとコンポーネントの基礎を理解する https://www.youtube.com/live/m4QGyK_UgS0?si=_P6NSHpGQkH71o7l ・第96回 雲勉 インフラエンジニアの Kubernetes 入門 https://youtu.be/PXIcz8_ZAIk?si=HKSygS6CMXjMdm4v
  4. 2.Amazon EKS Anywhere とは • オンプレミスでのKubernetes運用工数を、大幅に削減するソリューション • 無料で利用可能 • エンタープライズサブスクリプション購入で、AWSサポートが利用可能

    • Amazon EKS Distro上での構築により、Amazon EKSと同様の信頼性と安全性 • Amazon EKS Connector を使用することで、マネジメントコンソールからも管理が可能 • クラウド同等の管理が必要な場合や、運用効率化を行いたい場合の選択肢の1つ • オンプレミス、エッジ、どこでも楽々コンテナ管理 ! Amazon EKS Anywhere をグラレコで解説 https://aws.amazon.com/jp/builders-flash/202404/awsgeek-eks-anywhere/ • Amazon EKS Distro https://aws.amazon.com/jp/eks/eks-distro/ 7
  5. 2.Amazon EKS Anywhere とは 8 項目 Amazon EKS Amazon EKS

    Anywhere 動作環境 Amazon EC2、AWS Fargate ユーザーのインフラ コントロールプレーン AWS 管理 ユーザーによる管理 セキュリティ AWS とユーザーによる責任共有 ユーザーによるセキュリティ対策 コスト 従量課金制 無料(オンプレランニングコスト) ライセンス料金制(クラスター数基準) メリット 設定・運用の容易さ オンプレミスにおける クラスター管理の簡略化
  6. 13 user@test-eks-anywhere:~$ cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.2 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.2

    LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo user@test-eks-anywhere:~$ user@test-eks-anywhere:~$ docker --version Docker version 28.5.1, build e180ab8 user@test-eks-anywhere:~$ 4.Dockerプロバイダーの構築
  7. 14 user@test-eks-anywhere:~$ kubectl version Client Version: v1.34.1 Kustomize Version: v5.7.1

    The connection to the server localhost:8080 was refused - did you specify the right host or port? user@test-eks-anywhere:~$ user@test-eks-anywhere:~$ eksctl anywhere version Version: v0.23.4 Release Manifest URL: https://anywhere-assets.eks.amazonaws.com/releases/eks-a/manifest.yaml Bundle Manifest URL: https://anywhere- assets.eks.amazonaws.com/releases/bundles/107/manifest.yaml user@test-eks-anywhere:~$ 4.Dockerプロバイダーの構築(eksctlとkubectl)
  8. 16 5.クラスターを作成する user@test-eks-anywhere:~/eks-anywhere-test$ CLUSTER_NAME=mgmt eksctl anywhere generate clusterconfig $CLUSTER_NAME \

    --provider docker > $CLUSTER_NAME.yaml user@test-eks-anywhere:~/eks-anywhere-test$ user@test-eks-anywhere:~/eks-anywhere-test$ ll total 16 drwxrwxr-x 3 user user 4096 Nov 3 06:12 ./ drwxr-x--- 6 user user 4096 Nov 3 06:11 ../ drwxr-x--- 2 user user 4096 Nov 3 06:12 eksa-cli-logs/ -rw-rw-r-- 1 user user 639 Nov 3 06:12 mgmt.yaml user@test-eks-anywhere:~/eks-anywhere-test$
  9. 17 5.クラスターを作成する user@test-eks-anywhere:~/eks-anywhere-test$ cat mgmt.yaml apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: Cluster metadata:

    name: mgmt spec: clusterNetwork: cniConfig: cilium: {} pods: cidrBlocks: - 10.10.0.0/16 # ホストのCIDRと被らないように変更 services: cidrBlocks: - 10.96.0.0/12 # ホストのCIDRと被らないように変更 ~割愛~
  10. 18 user@test-eks-anywhere:~/test-eks-anywhere$ sudo eksctl anywhere create cluster -f mgmt.yaml Performing

    setup and validations Warning: The docker infrastructure provider is meant for local development and testing only Docker Provider setup is valid Validate OS is compatible with registry mirror configuration Validate certificate for registry mirror Validate authentication for git provider Validate cluster's eksaVersion matches EKS-A version Validate extended kubernetes version support is supported ~割愛~ Cluster created! -------------------------------------------------------------------------------------- The Amazon EKS Anywhere Curated Packages are only available to customers with the Amazon EKS Anywhere Enterprise Subscription -------------------------------------------------------------------------------------- Enabling curated packages on the cluster Installing helm chart on cluster {"chart": "eks-anywhere-packages", "version": "0.4.8-eks-a-107"} 5.クラスターを作成する
  11. 20 6.アクセスを確認する user@test-eks-anywhere:~/test-eks-anywhere$ kubectl apply -f "https://anywhere.eks.amazonaws.com/manifests/hello-eks- a.yaml" deployment.apps/hello-eks-a created

    service/hello-eks-a created user@test-eks-anywhere:~/test-eks-anywhere$ user@test-eks-anywhere:~/test-eks-anywhere$ user@test-eks-anywhere:~/test-eks-anywhere$ kubectl get pods -l app=hello-eks-a NAME READY STATUS RESTARTS AGE hello-eks-a-5ff5b8766b-klwkx 1/1 Running 0 119s user@test-eks-anywhere:~/test-eks-anywhere$ user@test-eks-anywhere:~/test-eks-anywhere$ kubectl get svc hello-eks-a NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-eks-a NodePort 10.104.57.21 <none> 80:30764/TCP 2m5s user@test-eks-anywhere:~/test-eks-anywhere$ user@test-eks-anywhere:~/test-eks-anywhere$ kubectl port-forward deploy/hello-eks-a 3000:80 Forwarding from 127.0.0.1:3000 -> 80 Forwarding from [::1]:3000 -> 80
  12. 23 7.個人制作のアプリをデプロイして、外部からアクセスしてみる user@test-eks-anywhere:~/test-eks-anywhere/chat-app-manifest/manifest-repo$ ll total 32 drwxrwxr-x 2 user user

    4096 Nov 4 11:23 ./ drwxrwxr-x 4 user user 4096 Nov 4 11:19 ../ -rw-rw-r-- 1 user user 2217 Nov 4 11:22 deployment.yaml -rw-rw-r-- 1 user user 1925 Nov 4 11:22 ingress.yaml -rw-rw-r-- 1 user user 60 Nov 4 11:18 namespace.yaml -rw-rw-r-- 1 user user 700 Nov 4 11:23 postgres-secret.yaml -rw-rw-r-- 1 user user 1259 Nov 4 11:22 postgres.yaml -rw-rw-r-- 1 user user 564 Nov 4 11:18 service.yaml user@test-eks-anywhere:~/test-eks-anywhere/chat-app-manifest/manifest-repo$ user@test-eks-anywhere:~/test-eks-anywhere/chat-app-manifest/manifest-repo$ kubectl apply -f ./
  13. 24 7.個人制作のアプリをデプロイして、外部からアクセスしてみる user@test-eks-anywhere:~/test-eks-anywhere/chat-app-manifest/manifest-repo$ kubectl get all -n chat-app NAME READY

    STATUS RESTARTS AGE pod/chat-backend-6577cffd4d-4gspr 1/1 Running 0 30m pod/chat-backend-6577cffd4d-x66fd 1/1 Running 0 30m pod/chat-frontend-5bf9467bf8-dl9jc 1/1 Running 0 38m pod/chat-frontend-5bf9467bf8-kl24s 1/1 Running 0 38m pod/postgres-0 1/1 Running 0 33m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/chat-backend ClusterIP 10.107.188.216 <none> 80/TCP 38m service/chat-frontend ClusterIP 10.106.131.138 <none> 80/TCP 38m service/postgres ClusterIP 10.107.31.226 <none> 5432/TCP 38m NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/chat-backend 2/2 2 2 38m deployment.apps/chat-frontend 2/2 2 2 38m NAME DESIRED CURRENT READY AGE replicaset.apps/chat-backend-5f6d6d69bc 0 0 0 38m replicaset.apps/chat-backend-6577cffd4d 2 2 2 30m replicaset.apps/chat-frontend-5bf9467bf8 2 2 2 38m NAME READY AGE statefulset.apps/postgres 1/1 33m
  14. 27 8.クラスタ作成時に問題発生。。。 Collecting support bundle from cluster, this can take

    a while {"cluster": "bootstrap- cluster", "bundle": "mgmt/generated/bootstrap-cluster-2025-11-03T07:20:21Z-bundle.yaml", "since": 1762143621771894602, "kubeconfig": "mgmt/generated/mgmt.kind.kubeconfig"} Support bundle archive created {"path": "support-bundle-2025-11-03T07_20_22.tar.gz"} Analyzing support bundle {"bundle": "mgmt/generated/bootstrap-cluster-2025-11- 03T07:20:21Z-bundle.yaml", "archive": "support-bundle-2025-11-03T07_20_22.tar.gz"} Analysis output generated {"path": "mgmt/generated/bootstrap-cluster-2025-11- 03T07:20:30Z-analysis.yaml"} Error: waiting for cluster's control plane to be ready: cluster condition ControlPlaneReady is False: Control plane nodes not ready yet, 1 expected (0 ready)
  15. 28 8.クラスタ作成時に問題発生。。。 Failed to create control group inotify object: Too

    many open files Failed to allocate manager object: Too many open files Exiting PID 1...
  16. 34 10.Appendix 参考URL Amazon EKS Anywhere Document https://anywhere.eks.amazonaws.com/docs/overview/ Cloudflare Tunnel

    https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/ inotifyとは https://ja.wikipedia.org/wiki/Inotify ファイルディスクリプタ https://e- words.jp/w/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%83%87%E3%82%A3%E3%82%B9%E3%82%AF%E 3%83%AA%E3%83%97%E3%82%BF.html