K8S基础
(2022-09-16 11:50:27)| 分类: 运维管理 |
kubectl create -f xxxx.yaml
kubectl edit -f deployment.yaml
kubectl apply -f deployment.yaml
kubectl get deployments
kubectl get pods -o wide
kubectl describe deployment
kubectl scale deployment/httpd-deployment --replicas=1
kubectl delete deployment httpd-deployment
kubectl get svc
kubectl get node
kubectl exec -it [PodName] -- /bin/bash
kubectl edit -f deployment.yaml
kubectl apply -f deployment.yaml
kubectl get deployments
kubectl get pods -o wide
kubectl describe deployment
kubectl scale deployment/httpd-deployment --replicas=1
kubectl delete deployment httpd-deployment
kubectl get svc
kubectl get node
kubectl exec -it [PodName] -- /bin/bash
============================================================
spec:
spec:
spec:
spec:
============================================================
重新 installation 前运行 :kubeadm reset
kubeadm join 前,确保节点时间一致
CNI网络插件: flannel 或者 calico
-- Pod网络插件仅在master上安zhuang
kubeadm部署k8s集群node一直是notready状态的解决方案:
解决方法,将master上/etc/cni/net.d 目录下的文件拷贝到有问题的节点上:
scp server4:/etc/cni/net.d/* /etc/cni/net.d/
kubeadm部署k8s集群node一直是notready状态的解决方案:
解决方法,将master上/etc/cni/net.d 目录下的文件拷贝到有问题的节点上:
scp server4:/etc/cni/net.d/* /etc/cni/net.d/
node not found : 原因 container image pull 不到。
V1.25
=== Container
生成containerd的配置文件
mkdir /etc/containerd -p
#生成配置文件
containerd config default > /etc/containerd/config.toml
#编辑配置文件
vim /etc/containerd/config.toml
SystemdCgroup = false 改为 SystemdCgroup = true
#这里pause的版本可以用 kubeadm config images list获取
#sandbox_image = "k8s.gcr.io/pause:3.7"
改为:
sandbox_image = "registry.aliyuncs.com/google_containers/pause:3.7"
#systemctl enable containerd
#systemctl start containerd
mkdir /etc/containerd -p
#生成配置文件
containerd config default > /etc/containerd/config.toml
#编辑配置文件
vim /etc/containerd/config.toml
SystemdCgroup = false 改为 SystemdCgroup = true
#这里pause的版本可以用 kubeadm config images list获取
#sandbox_image = "k8s.gcr.io/pause:3.7"
改为:
sandbox_image = "registry.aliyuncs.com/google_containers/pause:3.7"
#systemctl enable containerd
#systemctl start containerd

加载中…