Kubeadm是Kubernetes的一鍵部署工具。
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
vim /etc/apt/sources.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
apt-get update
apt-get install -y docker.io kubeadm
systemctl enable docker.service
cd /opt/kubernetes-config
kubeadm init --config kubeadm.yaml --v=5
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
kubectl describe node xxxx
kubectl get pods -n kube-system
kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')
cd /opt/kubernetes-config
kubeadm init --config kubeadm.yaml --v=5
mkdir -p $HOME/.kube
scp "master node config" $HOME/.kube
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubsercontent.com/kubenetes/dashboard/v2.0.3/aio/deploy/recommended.yaml
kubectl get svc -n kubenetes-dashboard
kubectl proxy
apiVersion: xxx
kind: ServiceAccount
metadata:
name: xxx
namespace: xxx
kubectl apply -f dashboard-adminuser.yaml
apiVersion: xxx
kind: ClusterRoleBingding
metadata:
name: xxx
roleRef:
apiGroup: xxx
kind: xxx
name: xxx
subjects:
- kind: xxx
name: xxx
namespace: xxx
kubectl apply -f dashboard-clusterRoleBingding.yaml
kubectl -n kubenetes-dashboard describe secret $(kubectl -n kubenetes-dashboard get secret | grep xxx | awk '{print $1}')