当前位置:网站首页>Eksctl deploying AWS eks
Eksctl deploying AWS eks
2022-04-23 04:33:00 【Heavy dust】
Catalog
One 、 Tool installation
1.1 install kubectl
stay Linux Installation on kubectl
-
from Amazon S3 For clustered Kubernetes Version download Amazon EKS Provided
kubectl
Binary . To download Arm edition , Please putamd64
Change toarm64
, Then run the corresponding command .-
Kubernetes 1.21:
curl -o kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/kubectl
-
Kubernetes 1.20:
curl -o kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.20.4/2021-04-12/bin/linux/amd64/kubectl
-
Kubernetes 1.19:
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
-
Kubernetes 1.18:
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/kubectl
-
-
Apply execution permissions to binaries .
chmod +x ./kubectl
-
Copy the binaries to your
PATH
Folder in . If you have installed a version ofkubectl
, It is recommended that you create a$HOME/bin/kubectl
And ensure$HOME/bin
First appear in your$PATH
in .mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin
-
( Optional ) take
$HOME/bin
Path added to shell Initialization file , In order to open shell Configure this path when .Be careful
This step assumes that you use Bash Shell; If you use other Shell, Please change the command to use your specific Shell Initialization file of .
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
-
install
kubectl
after , You can verify its version by using the following command :kubectl version --short --client
1.2 install eksctl
Use eksctl
stay Linux Install or upgrade on curl
-
Use the following command to download and extract the latest version of
eksctl
.curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
-
Move the extracted binary to
/usr/local/bin
.sudo mv /tmp/eksctl /usr/local/bin
-
Use the following command to test whether your installation is successful .
eksctl version
1.3 install Helm( Optional )
-
If you will macOS And Homebrew In combination with , Please use the following command to install binaries .
brew install helm
-
If you will Windows And Chocolatey In combination with , Please use the following command to install binaries .
choco install kubernetes-helm
-
If you are using Linux, Please use the following command to install binaries .
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 $ chmod 700 get_helm.sh $ ./get_helm.sh
Two 、 Imperative creation
2.1 establish Amazon EC2 Linux Managed node cluster
eksctl create cluster \
--name my-cluster \
--region us-west-2 \
--with-oidc \
--ssh-access \
--ssh-public-key <your-key> \
--managed
2.2 establish Fargate Linux node
eksctl create cluster \
--name my-cluster \
--region us-west-2 \
--fargate
2.3 See the resources
kubectl get nodes -o wide
2.4 Delete cluster
eksctl delete cluster --name my-cluster --region us-west-2
3、 ... and 、 The configuration file (yaml) establish
3.1 No choice VPC
nodeGroups
Is an unmanaged node group ,managedNodeGroups
by EKS Managed node group , Managed node groups can be displayed on the console .
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: basic-cluster
region: eu-north-1
nodeGroups:
- name: ng-1
instanceType: m5.large
desiredCapacity: 10
volumeSize: 80
ssh:
allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key
- name: ng-2
instanceType: m5.xlarge
desiredCapacity: 2
volumeSize: 100
ssh:
publicKeyPath: ~/.ssh/ec2_id_rsa.pub
managedNodeGroups:
- name: ng-1-workers
labels: {
role: workers }
instanceType: m5.xlarge
desiredCapacity: 10
volumeSize: 80
privateNetworking: true
- name: ng-2-builders
labels: {
role: builders }
instanceType: m5.2xlarge
desiredCapacity: 2
volumeSize: 100
privateNetworking: true
3.2 Select an existing VPC
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: cluster-in-existing-vpc
region: eu-north-1
vpc:
subnets:
private:
eu-north-1a: {
id: subnet-0ff156e0c4a6d300c }
eu-north-1b: {
id: subnet-0549cdab573695c03 }
eu-north-1c: {
id: subnet-0426fb4a607393184 }
nodeGroups:
- name: ng-1-workers
labels: {
role: workers }
instanceType: m5.xlarge
desiredCapacity: 10
privateNetworking: true
- name: ng-2-builders
labels: {
role: builders }
instanceType: m5.2xlarge
desiredCapacity: 2
privateNetworking: true
iam:
withAddonPolicies:
imageBuilder: true
3.3 Run the create command
eksctl create cluster -f cluster.yaml
3.4 Delete cluster
eksctl delete cluster -f cluster.yaml
Reference resources
eksctl:https://eksctl.io/introduction/
AWS EKS file : https://docs.aws.amazon.com/zh_cn/eks/latest/userguide/what-is-eks.html
版权声明
本文为[Heavy dust]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230413460252.html
边栏推荐
猜你喜欢
【Echart】echart 入門
[AI vision · quick review of today's sound acoustic papers, issue 3] wed, 20 APR 2022
【论文阅读】【3d目标检测】Improving 3D Object Detection with Channel-wise Transformer
递归调用--排列的穷举
单片机串口数据处理(2)——uCOSIII+循环队列接收数据
Xiaohongshu was exposed to layoffs of 20% as a whole, and the internal volume among large factories was also very serious
C语言:恶搞小游戏
C语言常用字符串处理函数
Jetpack 之 LifeCycle 组件使用详解
[AI vision · quick review of robot papers today, issue 32] wed, 20 APR 2022
随机推荐
在AWS控制台创建VPC(无图版)
mysql ,binlog 日志查询
Express中间件①(中间件的使用)
[AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022
Stm32f4 MCU ADC sampling and FFT of ARM-DSP Library
io.Platform.packageRoot; // ignore: deprecated_member_use
Differences among electric drill, electric hammer and electric pick
无线键盘全国产化电子元件推荐方案
Basic use of shell WC (counting the number of characters)
Iron and intestinal flora
顺序表的基本操作
Mysql出现2013 Lost connection to MySQL server during query
php导出Excel表格
指纹Key全国产化电子元件推荐方案
補:注解(Annotation)
TreeSet课后练习
229. 求众数 II
Matlab minimalist configuration of vscode configuration
递归调用--排列的穷举
Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)