跳至主要內容

k8s入门学习笔记

OrangBus小于 1 分钟

minikube start --vm-driver=virtualbox --image-mirror-country=cn --registry-mirror=https://reg-mirror.qiniu.com
## or

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=
    

pod

创建一个Pod