一、ingress案例
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/baremetal/deploy.yaml grep image deploy.yaml #查看模板使用的镜像k8s.gcr.io/ingress-nginx/controller:v0.46.0,然后提前下载,否则发布pod时很慢; docker pull k8s.gcr.io/ingress-nginx/controller:v0.46.0 docker save -o ingress-nginx.tar k8s.gcr.io/ingress-nginx/controller:v0.46.0 #镜像打包; tar -czvf ingress-nginx.tar.gz ingress-nginx.tar ~~~~将ingress-nginx.tar.gz上传至master、各node,并在各node导入镜像; tar -xzvf ingress-nginx.tar.gz docker load -i ingress-nginx.tar docker images |grep ingress #确认各node的镜像缓存在本地; ##在master以下命令 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/baremetal/deploy.yaml #确认yaml中文件的镜像与各node缓存的镜像一致; kubectl get pods -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx #验证ingress-nginx;