k8s入门学习笔记
小于 1 分钟
环境安装
https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download
minikube start --vm-driver=virtualbox --image-mirror-country=cn --registry-mirror=https://reg-mirror.qiniu.com
metadata.name = nginx-pod
kubectl expose pods nginx-pod --type=NodePort
访问: node_ip + expose_port
labels
设置labels
kubectl label nodes minikube env=orangbus
删除lables
kubectl label nodes minikube env-
查看lables
kubectl get nodes --show-labels
roles
设置
kubectl label nodes minikube node-role.kubernetes.io/master= kubectl label nodes minikube node-role.kubernetes.io/worker=