小结
在Linux环境中对AWS CLI和EKSCTL的客户端进行了设置。
过程
安装AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
安装EKSCTL
# for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
在两个Kubernetes Cluster之间切换
在本地环境中的一个Kubernetes Cluster,在AWS中也有一个Kubernetes Cluster,两个环境之间进行切换:
查看两个环境:
[root@Master ~]# kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* kubernetes-admin@kubernetes kubernetes kubernetes-admin
xxx@yyy@john-1-cluster.ap-southeast-1.eksctl.io john-1-cluster.ap-southeast-1.eksctl.io xxx@yyy@john-1-cluster.ap-southeast-1.eksctl.io
目前是本地环境,切换至AWS:
[root@Master ~]# kubectl config use-context xxx@yyy@john-1-cluster.ap-southeast-1.eksctl.io
Switched to context "xxx@yyy@john-1-cluster.ap-southeast-1.eksctl.io".
[root@Master ~]#
[root@Master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-192-168-42-199.ap-southeast-1.compute.internal Ready <none> 3m15s v1.27.7-eks-e71965b
ip-192-168-7-243.ap-southeast-1.compute.internal Ready <none> 3m11s v1.27.7-eks-e71965b
[root@Master ~]# kubectl get pods -o wide -A
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system aws-node-9nzj5 1/1 Running 0 36m 192.168.7.243 ip-192-168-7-243.ap-southeast-1.compute.internal <none> <none>
kube-system aws-node-wl6h4 1/1 Running 0 36m 192.168.42.199 ip-192-168-42-199.ap-southeast-1.compute.internal <none> <none>
kube-system coredns-66dddcb88c-lv9hb 1/1 Running 0 44m 192.168.44.60 ip-192-168-42-199.ap-southeast-1.compute.internal <none> <none>
kube-system coredns-66dddcb88c-r2vh9 1/1 Running 0 44m 192.168.45.98 ip-192-168-42-199.ap-southeast-1.compute.internal <none> <none>
kube-system kube-proxy-9sd55 1/1 Running 0 36m 192.168.7.243 ip-192-168-7-243.ap-southeast-1.compute.internal <none> <none>
kube-system kube-proxy-9tmjs 1/1 Running 0 36m 192.168.42.199 ip-192-168-42-199.ap-southeast-1.compute.internal <none> <none>
[root@Master ~]# kubectl top nodes
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
ip-192-168-42-199.ap-southeast-1.compute.internal 18m 0% 448Mi 6%
ip-192-168-7-243.ap-southeast-1.compute.internal 20m 1% 425Mi 6%
参考
Install or update the latest version of the AWS CLI
Getting started with Amazon EKS – eksctl
EKSCTL安装
Kubenetes Configure Access to Multiple Clusters
原文地址:https://blog.csdn.net/scruffybear/article/details/134578974
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_2205.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。