4.3、检查traefik#每个node节点上部署一个traefikkubectlget pod,deploy,daemonset,service,ingress -n kube-system | grep traefik### 显示如下pod/traefik-ingress-controller-gl7vs1/1Running043mpod/traefik-ingress-controller-qp26j1/1Running043mpod/traefik-ingress-controller-x99ls1/1Running043mdaemonset.extensions/traefik-ingress-controller33333<none>43mservice/traefik-ingress-serviceClusterIP10.254.148.220<none>80/TCP,8080/TCP43mservice/traefik-web-uiClusterIP10.254.139.95<none>80/TCP43mingress.extensions/traefik-web-uitraefik-ui8043m# 访问返回如下:curl -H 'host:traefik-ui' 192.168.10.11<a href=https://www.isolves.com/it/cxkf/jiagou/2020-08-13/"/dashboard/">Found.curl -H 'host:traefik-ui' 192.168.10.12Found.curl -H 'host:traefik-ui' 192.168.10.13Found.#查看端口netstat -lntup|grep traefiktcp600 :::8080:::*LISTEN66426/traefiktcp600 :::80:::*LISTEN66426/traefik #然后访问http://192.168.10.11:8080/4.4、检查metricskubectl top node###报错:Error from server (Forbidden): forbidden: User "system:anonymous" cannot get path "/apis/metrics.k8s.io/v1beta1"Error from server (Forbidden): nodes.metrics.k8s.io is forbidden: User "system:anonymous" cannot list resource "nodes" in API group "metrics.k8s.io" at the cluster scope###解决办法kubectl create clusterrolebinding the-boss --user system:anonymous --clusterrole cluster-admin### 遇到报错:Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)4.5、检查EFKes:http://192.168.10.11:32698/Kibana: http://192.168.10.11:326995、验证集群# 部署glusterfs 参考:https://www.cnblogs.com/fan-gx/p/12101686.htmlkubectl create ns myappkubectl apply -f nginx.yaml kubectl get pod,svc,ing -n myapp -o wide###显示如下NAMEREADYSTATUSRESTARTSAGEIPNODENOMINATED NODEREADINESS GATESpod/my-nginx-69f8f65796-zd7771/1Running019m172.30.36.15192.168.10.11<none><none>NAMETYPECLUSTER-IPEXTERNAL-IPPORT(S)AGESELECTORservice/my-nginxClusterIP10.254.131.1<none>80/TCP21mapp=my-nginxNAMEHOSTSADDRESSPORTSAGEingress.extensions/my-nginxmyapp.nginx.com8021m#验证访问是否正常curl http://172.30.36.15curl http://10.254.131.1curl -H "host:myapp.nginx.com" 192.168.10.11### 通过谷歌浏览器访问:http://192.168.10.100:8088/### 我们部署的时候已经通过nginx代理了traefik地址 /data/nginx/conf/nginx.confkubectl exec -it my-nginx-69f8f65796-zd777 -n myapp bashecho "hello world" >/usr/share/nginx/html/index.html #然后浏览器访问http://192.168.10.100:8088/ 显示 hello world6、重启所有组件systemctl restart etcd && systemctl status etcdsystemctl restart flanneld && systemctl status flanneldsystemctl restart docker && systemctl status dockersystemctl stop nginx && systemctl start nginx && systemctl status nginxsystemctl restart keepalived && systemctl status keepalivedsystemctl restart kube-apiserver && systemctl status kube-apiserversystemctl restart kube-controller-manager && systemctl status kube-controller-managersystemctl restart kube-scheduler && systemctl status kube-schedulersystemctl restart kubelet && systemctl status kubeletsystemctl restart kube-proxy && systemctl status kube-proxy作者:Fantasy
出处:http://dwz.date/bWku
20个免费 K8S 名额:http://dwz.date/bUTc
【ansible部署k8s】
推荐阅读
- 利用docker部署solo并升级为https
- MYSQL主主模式 LNMP 独立部署配置指导书
- K8S常用命令
- 蚂蚁集团针对 K8s 中 Secret 安全防护的实践与探索
- K8S部署指导书
- Vue 中如何从插槽中发出数据
- Istio+K8s,微服务的双剑合璧
- nginx单节点部署
- Kafka-manager部署与使用简单介绍
- redis5.0.7 版本集群liunx部署简易流程
