k8s 遇到的问题及基础命令笔记

kubeadm join 192.168.101.104:6443 --token g7dylp.y6yup3cpc2g3lj8e --discovery-token-ca-cert-hash sha256:cc10c312f125c4d3c4c55390563c5b7bccce52dc78ca1f6d02661a6a22362deb


**kubeadm reset
kubeadm init --kubernetes-version=v1.12.1 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.101.104 --ignore-preflight-errors=all

–token-ttl设置为0表示永不过期

重启kubelet:
systemctl enable kubelet && systemctl start kubelet
---------------------------------------------------------------------------

docker pull quay-mirror.qiniu.com/coreos/flannel:v0.10.0-amd64
docker pull registry.aliyuncs.com/google_containers/kube-proxy
----------------------------------------------------------------------

kubeadm join 192.168.101.104:6443 --token rh6of5.m7lr86d1p03w627i --discovery-token-ca-cert-hash sha256:3afa30517a4ecd14442f41fde66eed91e6445cecabebafa739b22aabb03324e5
-----------------------------------------------**--------------------------------

journalctl -f -u kubelet


命令:systemctl enable kubelet && systemctl start kubelet
问题: Failed to execute operation: File exists
解决:systemctl daemon-reload


failed to get azure cloud in GetVolumeLimits, plugin.host: k8s-master
vi /etc/sysconfig/kubelet
KUBELET_EXTRA_ARGS=–feature-gates=AttachVolumeLimit=false
systemctl restart kubelet


Unable to update cni config: No networks found in /etc/cni/net.d
cni config uninitialized
解决办法:

docker pull quay.io/coreos/flannel:v0.9.1-amd64
或者
docker pull quay-mirror.qiniu.com/coreos/flannel:v0.10.0-amd64

mkdir -p /etc/cni/net.d/

cat < /etc/cni/net.d/10-flannel.conf
{“name”:“cbr0”,“type”:“flannel”,“delegate”: {“isDefaultGateway”: true}}
EOF
mkdir /usr/share/oci-umount/oci-umount.d -p
mkdir /run/flannel/
cat < /run/flannel/subnet.env
FLANNEL_NETWORK=172.100.0.0/16
FLANNEL_SUBNET=172.100.1.0/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
EOF

kubectl apply -f kube-flannel.yml


docker run -d -p 5000:5000 --privileged=true -v /data/history:/data/registry registry
docker images

curl -XGET http://192.168.101.104:5000/v2/_catalog

culture.com.cn

你可能感兴趣的:(k8s+docker)