k 8 s一般的なエラー解決--継続的な更新


k 8 sよくあるエラー処理
  • [WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/error execution phase preflight: [preflight] Some fatal errors occurred:
  • cat > /etc/docker/daemon.json <
  • [ERROR FileContent–proc-sys-net-ipv4-ip_forward]:/proc/sys/net/ipv4/ip_forward contents are not set to 1

  • echo “1” >/proc/sys/net/ipv4/ip_forward
  • [ERROR DirAvailable–var-lib-etcd]:/var/lib/etcd is not empty

  • rm -rf/var/lib/etcd
  • failed to load Kubelet config file/var/lib/kubelet/config.yaml
  • unable to load client CA file/etc/kubernetes/pki/ca.crt
  • failed to run Kubelet: unable to load bootstrap kubeconfig: stat/etc/kubernetes/bootstrap-kubelet.conf: no such file or directory

  • 背景:nodeノードkubeadm reset後再kubeadm join失敗
  • Failed to execute iptables-restore:exit status 1(invalid option-‘5’)解決:iptablesバージョンを下げる、現在のiptables-1.4.21-28.el7.x86_64、iptables-1.4.21-24にロールバックする.el7.x86_64 (centos7.5)
  • Error from server (Forbidden): secrets is forbidden: User “system:node:master” cannot create resource “secrets” in API group “” in the namespace “kube-system”: can only read resources of this type

  • export KUBECONFIG=/etc/kubernetes/admin.conf
  • Error from server (AlreadyExists): secrets “kubernetes-dashboard-certs” already exists

  • kubectl delete -f kubernetes-dashboard.yaml再apply
  • The Service “kubernetes-dashboard” is invalid: spec.ports[0].nodePort: Forbidden: may not be used when type is ‘ClusterIP’

  • kubectl -n kube-system describe $(kubectl -n kube-system get secret -n kube-system -o name | grep namespace) | grep token
    ClusterIPをNodePortに変更