Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
EKS Anywhere on vSphere
Search
masanara
September 21, 2021
Technology
59
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EKS Anywhere on vSphere
2021年9月10日にEKS AnywhereがGAされ たのでvSpehre上にイントールして使ってみ た。
masanara
September 21, 2021
More Decks by masanara
See All by masanara
vSphere環境でLLMをServeする
masanara
0
290
Cartographer入門
masanara
0
530
kpackによるコンテナイメージのビルド
masanara
0
140
Harbor RegistryのReplication機能
masanara
0
450
Kubernetes Operator for vSphere VM
masanara
0
70
Other Decks in Technology
See All in Technology
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
460
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
670
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2.1k
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
130
人間はどの意思決定を手放せるのか
kawasima
15
7.5k
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.8k
WordPressの脆弱性対策何をすべき?
masakawai
0
110
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
150
銀行勘定系システムにおける開発プロセス刷新×AIによる環境モダナイゼーション / Development Process Transformation and AI-Driven Environment Modernization
muit
1
2.4k
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
cscengineer
PRO
0
120
AIは推し活である。
kurazuuuuuu
1
840
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Visualization
eitanlees
152
17k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
Agile that works and the tools we love
rasmusluckow
331
22k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
HDC tutorial
michielstock
2
870
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
520
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Transcript
EKS Anywhere on vSphere VMware DevOps Meetup #10 2021/09/22
本日の内容 2021年9月10日にEKS AnywhereがGAされ たのでvSpehre上にイントールして使ってみ た。 - クラスターの作成方法 - GitOpsの利用 -
EKS Connectorの利用 https://qiita.com/masanara/items/8643205083e8560c30f3
EKS Anywhereとは • Amazon EKSで利用されているKuberentesディストリビューションであるAmazon EKS Distroをオンプレミス環境で利用するためのもの。 • Cluster APIでKubernetesクラスターをプロビジョニング。
• 現在vSphereもしくはDockerに対応。今後ベアメタルにも対応予定。 • クラスターデプロイ時のオプションでFluxを構成してGitOpsが可能。 • 使うだけなら無料。サポートはAWSが有償提供。 • EKS Anywhere Documentation https://anywhere.eks.amazonaws.com/docs/overview/
事前準備 • Bootstrapノード (kind) ◦ 4 CPU cores / 16GB
memory ◦ Mac OS(10.15)/Ubuntu (20.04.2 LTS) ◦ Docker 20.x.x • vSphere ◦ vSphere 7以上 ◦ EKS Anywhereクラスターを実行するポートグループで DHCPを有効化 ◦ EKS Anywhereクラスターを実行するポートグループでクラスターの APIが利用する固定IPアドレス の確保 ◦ 仮想マシンインベントリに VMテンプレートを格納するための Templatesフォルダを作成 • GitHub ◦ GitOpsを利用する場合、GitHubアカウントでrepoスコープのアクセス権を持つ Personal access tokenを作成
EKS Anywhereの準備 eksctlとeksctl-anywhereプラグインのインストール。 curl "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" \ --silent --location \
| tar xz -C /tmp sudo mv /tmp/eksctl /usr/local/bin/ export EKSA_RELEASE="0.5.0" OS="$(uname -s | tr A-Z a-z)" curl "https://anywhere-assets.eks.amazonaws.com/releases/eks-a/1/artifacts/eks-a/v${EKSA_RELEASE}/${OS}/eksctl-anywhere -v${EKSA_RELEASE}-${OS}-amd64.tar.gz" \ --silent --location \ | tar xz ./eksctl-anywhere sudo mv ./eksctl-anywhere /usr/local/bin/ eksctl anywhere version v0.5.0
クラスター設定ファイルの作成 eksctl anywhereコマンドを利用してクラスター設定ファイルを作成する。 eksctl anywhere generate clusterconfig eksacl --provider vsphere
> eksa-cluster.yaml grep -B1 ^kind eksa-cluster.yaml apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: Cluster -- apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereDatacenterConfig -- apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereMachineConfig -- apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereMachineConfig -- apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereMachineConfig https://anywhere.eks.amazonaws.com/docs/reference/clusterspec/
クラスターのAPIのアドレスや構成するノードの数等を指定する。 設定ファイルの編集 : Cluster apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: Cluster metadata: name:
eksacl spec: clusterNetwork: cni: cilium pods: cidrBlocks: - 192.168.0.0/16 services: cidrBlocks: - 10.96.0.0/12 controlPlaneConfiguration: count: 2 endpoint: host: "192.168.30.100" machineGroupRef: kind: VSphereMachineConfig name: eksacl-cp datacenterRef: kind: VSphereDatacenterConfig name: eksacl externalEtcdConfiguration: count: 3 machineGroupRef: kind: VSphereMachineConfig name: eksacl-etcd kubernetesVersion: "1.21" workerNodeGroupConfigurations: - count: 2 machineGroupRef: kind: VSphereMachineConfig name: eksacl gitOpsRef: kind: GitOpsConfig name: eksacl GitOpsを有効化する場合は、 spec.gitOpsRefを追 加する。
EKSクラスター作成先のvCenter、データセンター名、ポートグループ名を指定する。 設定ファイルの編集 : VSphereDatacenterConfig apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereDatacenterConfig metadata: name:
eksacl spec: datacenter: "Tanzu-DC" insecure: true network: "/Tanzu-DC/Network/eks" server: "tanzu-vc.example.com" thumbprint: "" insecure : true でvCenterの証明書確認をスキップできる。
設定ファイルの編集 : VSphereMachineConfig 作成する仮想マシンの構成を指定する。コントロールプレーン、ノード、etcdクラスターそ れぞれに対して、異なる設定が可能。 apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: VSphereMachineConfig metadata:
name: eksacl-cp|eksacl|eksacl-etcd spec: datastore: "vsanDatastore" diskGiB: 25 folder: "" memoryMiB: 8192 numCPUs: 2 osFamily: bottlerocket resourcePool: "/Tanzu-DC/host/Tanzu-Cluster/Resources/eks" users: - name: ec2-user sshAuthorizedKeys: - ssh-rsa AAAA... osFamiliyは bottlerocket もしくは ubuntu を指定可能。 bottlerocket : コンテナの実行に最適化され たAWSのLinuxディストリビューション https://aws.amazon.com/bottlerocket/
設定ファイルの編集 : GitOpsConfig クラスター内に構成されるFluxが参照するGitHubの情報を指定する。 apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: GitOpsConfig metadata: name:
eksacl spec: flux: github: branch: main clusterConfigPath: clusters/eksacl fluxSystemNamespace: flux-system owner: masanara personal: true repository: eksagitops
クラスターの作成 GitHubのPersonal Acess Token、vSphereのクレデンシャルを環境変数として指定して から、eksctl anywhereコマンドでクラスターを作成する。 export EKSA_GITHUB_TOKEN=ghp_MyValidPersonalAccessTokenWithRepoPermissions export EKSA_VSPHERE_USERNAME='
[email protected]
'
export EKSA_VSPHERE_PASSWORD='VMware1!' eksctl anywhere create cluster -f eksa-cluster.yaml ... ... ... ... Writing cluster config file Deleting bootstrap cluster 🎉 Cluster created! etcd master Unstacked/External etcd • マスターとetcdを分離することで、マスターの障害や kube-apiserverのメモリーリークか らetcdを守ることができる。 • etcdはリソース消費が多いため、マスターから独立することが望ましい。 • masterと統合する構成も可能。 https://anywhere.eks.amazonaws.com/docs/reference/clusterspec/etcd/
クラスター名のディレクトリ内に作成したクラスターにアクセスするためのkubeconfigが 作成されている。 クラスターの利用 export KUBECONFIG=eksacl/eksacl-eks-a-cluster.kubeconfiga kubectl config get-contexts CURRENT NAME
CLUSTER AUTHINFO NAMESPACE * eksacl-admin@eksacl eksacl eksacl-admin kubectl get node NAME STATUS ROLES AGE VERSION 192.168.201.128 Ready control-plane,master 5m40s v1.21.3 192.168.201.16 Ready control-plane,master 7m29s v1.21.3 192.168.201.32 Ready <none> 6m4s v1.21.3 192.168.201.64 Ready <none> 6m5s v1.21.3 { "architecture": "amd64", "bootID": "26b30dfb-7a90-47de-9d39-b8b0e5630861", "containerRuntimeVersion": "containerd://1.4.8+bottlerocket", "kernelVersion": "5.10.50", "kubeProxyVersion": "v1.21.3", "kubeletVersion": "v1.21.3", "machineID": "76ba2e4266991c3605db79339c867c8f", "operatingSystem": "linux", "osImage": "Bottlerocket OS 1.2.0", "systemUUID": "76ba2e42-6699-1c36-05db-79339c867c8f" }
GitOpsの利用 GitOpsを有効にすることで、作成されるクラスターでFluxが有効化され、GitOpsConfig で指定したGitHubリポジトリにクラスターの設定ファイルが置かれる。 kubectl get pod -n flux-system NAME READY
STATUS RESTARTS AGE helm-controller-6d875c9745-mm4c4 1/1 Running 0 122m kustomize-controller-74c85f9944-nqlkh 1/1 Running 0 122m notification-controller-7c59756d9d-8lplx 1/1 Running 0 122m source-controller-65dcfdf7f7-57kwr 1/1 Running 0 122m
GitOpsの利用 FluxはGitHubリポジトリをポーリングし、変更があると変更内容をクラスターに反映す る。 apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: Cluster metadata: creationTimestamp: null
name: eksacl spec: workerNodeGroupConfigurations: - count: 3 apiVersion: anywhere.eks.amazonaws.com/v1alpha1 kind: Cluster metadata: creationTimestamp: null name: eksacl spec: workerNodeGroupConfigurations: - count: 2
Kubernetes環境のService(type:LoadBalancer)をNSX Advanced LoadBalancerで提 供可能。 Avi Kubernetes Operator https://qiita.com/masanara/items/23fc3dfc5568356ca986
GitOpsを利用したAvi Kubernetes Operatorの構成 HelmRepository/HelmRelaseを利用してEKS Anywhereクラスター上にAvi Kuubernetes Operatorを構成可能。 apiVersion: v1 kind:
Namespace metadata: name: avi-system --- apiVersion: source.toolkit.fluxcd.io/v1beta1 kind: HelmRepository metadata: name: ako namespace: avi-system spec: interval: 5m url: https://projects.registry.vmware.com/chartrepo/ako --- apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: ako namespace: avi-system spec: interval: 5m chart: spec: chart: ako version: ">=1.5.0" sourceRef: kind: HelmRepository name: ako namespace: avi-system interval: 1m valuesFrom: - kind: ConfigMap name: ako-values
EKS Connector EKS以外のKubernetesクラスターをAWSマネジメントクラスターから管理可能にする。
EKS Connector Tanzu Kubernetes Clusterも登録できました。
EKS AnywhereとTanzu Kubernetes Grid 同じCluster APIを利用しているが、作成されるクラスターの実装は異なる。 EKS Anywhere Tanzu Kubernetes
Grid 実行環境 vSphere (Docker) vSphere/AWS/Azure etcd Unstacked/External Stacked ClusterAPI セルフホスト Management Clsuter CNI Cilium Antrea/Calico CSI vSphere CSI vSphere CSI LoadBalancer なし (kube-vip推奨) NSX-T/NSX-ALB GitOps Flux kapp controller https://anywhere.eks.amazonaws.com/docs/tasks/cluster/cluster-integrations/
自宅 EKS Anywhere $ eksctl anywhere generate clusterconfig -p docker
docker-eksa > docker-eksa.yaml $ eksctl anywhere create cluster -f docker-eksa.yaml Performing setup and validations Warning: The docker infrastructure provider is meant for local development and testing only ✅ Docker Provider setup is valid Creating new bootstrap cluster Installing cluster-api providers on bootstrap cluster Provider specific setup Creating new workload cluster Installing networking on workload cluster Installing storage class on workload cluster Installing cluster-api providers on workload cluster Moving cluster management from bootstrap to workload cluster Installing EKS-A custom components (CRD and controller) on workload cluster Creating EKS-A CRDs instances on workload cluster Installing AddonManager and GitOps Toolkit on workload cluster GitOps field not specified, bootstrap flux skipped Writing cluster config file Deleting bootstrap cluster 🎉 Cluster created! $ KUBECONFIG=docker-eksa/docker-eksa-eks-a-cluster.kubeconfig kubectl get node NAME STATUS ROLES AGE VERSION docker-eksa-8qrj4 Ready control-plane,master 4m34s v1.21.2-eks-1-21-4 docker-eksa-md-0-6b766ff5d9-bqdpc Ready <none> 3m58s v1.21.2-eks-1-21-4 $ docker ps --format "table {{.Image}}\t{{.Ports}}\t{{.Names}}" IMAGE PORTS NAMES public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.21.2-eks-d-1-21-4-eks-a-1 docker-eksa-md-0-6b766ff5d9-bqdpc public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.21.2-eks-d-1-21-4-eks-a-1 42239/tcp, 127.0.0.1:42239->6443/tcp docker-eksa-8qrj4 public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.21.2-eks-d-1-21-4-eks-a-1 docker-eksa-etcd-9swbk kindest/haproxy:v20210715-a6da3463 40519/tcp, 0.0.0.0:40519->6443/tcp docker-eksa-lb
ありがとうございました