重启K8S服务
systemctl stop kubeletsystemctl stop kube-apiserversystemctl stop kube-proxysystemctl stop kube-controller-manager # 如果是master节点,需要执行systemctl stop kube-scheduler # 如果是master节点,需要执行systemctl stop flanneldsystemctl stop dockersystemctl restart iptablessystemctl start flanneldsystemctl start dockersystemctl start kubeletsystemctl start kube-apiserversystemctl start kube-proxysystemctl start kube-controller-manager # 如果是master节点,需要执行systemctl start kube-scheduler # 如果是master节点,需要执行systemctl status NetworkManager
查看kube-dns服务
[root@yp-epc-test1 /opt/install/harbor]# kubectl get po -o wide --namespace=kube-systemNAME READY STATUS RESTARTS AGE NODEkube-dns-v8-9xf6o 3/3 Running 20 55m 10.10.10.7
重启kube-dns服务
[root@yp-epc-test1 /opt/install/kubernetes]# pwd/opt/install/kubernetes[root@yp-epc-test1 /opt/install/kubernetes]# ll *dns*-rw-r----- 1 root root 1636 Aug 24 2017 skydns-rc.yaml-rw-r----- 1 root root 376 Aug 21 2017 skydns-svc.yamlkubectl delete -f skydns-rc.yamlkubectl delete -f skydns-svc.yamlkubuctl create -f skydns-rc.yamlkubuctl create -f skydns-svc.yamlkubectl describe pod kube-dns-v8-9xf6o --namespace=kube-system
重启harbor
cd /opt/install/harbordocker-compose downdocker-compose up -d #后台启动curl http://ip:80 #查看是否启动OK
harbor报502 Gate way
错误
现在的解决办法是,不停的关闭,重启,直至OK
重装iptables
配置文件备份
cat /etc/sysconfig/iptables# sample configuration for iptables service# you can edit this manually or use system-config-firewall# please do not ask us to add additional ports/services to this default configuration*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT-A INPUT -p tcp -m tcp --dport 8081 -j ACCEPT-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT-A INPUT -p tcp -m tcp --dport 10250 -j ACCEPT-A INPUT -p tcp -m tcp --dport 2379 -j ACCEPT-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT -m comment --comment "mariadb"-A INPUT -p tcp -m tcp --dport 4567 -j ACCEPT -m comment --comment "mariadb"-A INPUT -p tcp -m tcp --dport 4444 -j ACCEPT -m comment --comment "mariadb"-A INPUT -p tcp -m tcp --dport 30118 -j ACCEPT -m comment --comment "mariadb-vport"COMMIT
卸载,然后重装
[root@yp-epc-test1 /opt/install/harbor]# yum list| grep iptablesiptables.x86_64 1.4.21-16.el7 @base iptables-services.x86_64 1.4.21-16.el7 @base iptables.i686 1.4.21-16.el7 base iptables-devel.i686 1.4.21-16.el7 base iptables-devel.x86_64 1.4.21-16.el7 base iptables-utils.x86_64 1.4.21-16.el7 base yum remove iptable #卸载yum install -y iptables.x86_64 yum install -y iptables-services.x86_64 #需要安装systemctl enable iptablessystemctl restart iptables
在指定节点运行pod
apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: tomcat-deployspec: replicas: 1 template: metadata: labels: app: tomcat-app spec: nodeName: k8s.node1 #指定调度节点为k8s.node1 containers: - name: tomcat image: tomcat:8.0 ports: - containerPort: 8080