标签:log href style mirror http etc 程序 自动补全 txt
[root@k8s-01 ~]# cat /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg [root@k8s-01 ~]# yum -y install kubectl
[root@k8s-01 ~]# cat /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
root@k8s01:~# sudo snap install kubectl --classic
[root@k8s01 ~]# curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl [root@k8s01 ~]# chmod +x ./kubectl [root@k8s01 ~]# sudo mv ./kubectl /usr/local/bin/kubectl
参考文档:https://kubernetes.io/docs/tasks/tools/install-kubectl/
[root@k8s-01 ~]# yum -y install bash-completion [root@k8s-01 ~]# echo "source <(kubectl completion bash)" >> ~/.bashrc
kubectl若对接Kubernetes集群,需要一个kubeconfig文件,该文件在使用kube-up.sh创建集群或成功部署Minikube集群时自动创建。默认情况下,kubectl配置位于~/.kube/config。
主配置文件:~/.kube/config
更多Kubetcl使用参考:https://kubernetes.io/docs/reference/kubectl/kubectl/
标签:log href style mirror http etc 程序 自动补全 txt
原文地址:https://www.cnblogs.com/liujunjun/p/12243388.html