摘要: apiVersion: v1 kind: Service metadata: name: ingress-nginx namespace: ingress-nginx spec: type: ClusterIP ports: - name: http port: 80 targetPort: 80 阅读全文
posted @ 2022-06-28 17:43 opscool 阅读(43) 评论(0) 推荐(0)
摘要: 步骤如下: 1、yum install -y bash-completion 2、source /usr/share/bash-completion/bash_completion 3、source <(kubectl completion bash) 4、echo "source <(kubect 阅读全文
posted @ 2022-06-28 17:03 opscool 阅读(151) 评论(0) 推荐(0)
摘要: 一般情况下 我们是在maste节点上安装网络插件的,然后在join node 节点,这样导致node节点可能无法加载到这些插件 使用如下命令查看kubelet状态 journalctl -f -u kubelet 显示如下内容 no valid networks found in /etc/cni 阅读全文
posted @ 2022-06-28 17:03 opscool 阅读(213) 评论(0) 推荐(0)
摘要: 1、使用 reset命令清理之前加入的信息。 kubeadm reset -f 2、根据提示执行 iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X 3、在master上获取token kubeadm t 阅读全文
posted @ 2022-06-28 17:02 opscool 阅读(1520) 评论(0) 推荐(0)
摘要: journalctl -xefu kubelet 阅读全文
posted @ 2022-06-28 17:01 opscool 阅读(379) 评论(0) 推荐(0)
摘要: 步骤如下: 1、kubeadm reset -f 2、rm -rf ~/.kube/ 3、rm -rf /etc/kubernetes/ 4、rm -rf /etc/systemd/system/kubelet.service.d 5、rm -rf /etc/systemd/system/kubel 阅读全文
posted @ 2022-06-28 17:01 opscool 阅读(845) 评论(0) 推荐(0)
摘要: 解决方法步骤: 1、yum install firewalld 2、systemctl unmask firewalld 3、systemctl enable firewalld 4、systemctl start firewalld 阅读全文
posted @ 2022-06-28 16:59 opscool 阅读(680) 评论(0) 推荐(0)
摘要: 总是拉取 pull imagePullPolicy:Always 只使用本地镜像,从不拉取 imagePullPolicy:Nerver 默认值,本地有则使用本地镜像,不拉取 imagePullPolicy:IfNotPresent 阅读全文
posted @ 2022-06-28 16:58 opscool 阅读(112) 评论(0) 推荐(0)
摘要: Metrics Server 部署 先拉取yaml文件 wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml 修改yaml文件 containers: - nam 阅读全文
posted @ 2022-06-28 16:57 opscool 阅读(105) 评论(0) 推荐(0)
摘要: 原因: 因为ingress controller的镜像 pull 失败,一直在 retry ,所以我就把 ingress-controller delete 掉,但是一直卡住在删除 namespace 强制结束以后发现 pod 已经被删掉,导入容器以后重新 create 报错,报错内容就是 ingr 阅读全文
posted @ 2022-06-28 16:56 opscool 阅读(475) 评论(0) 推荐(0)
摘要: 默认master节点是taint,可用如下方法来去掉taint kubectl taint nodes master节点主机名 node-role.kubernetes.io/master- 查看 kubectl describe node master节点主机名 | grep Taints 阅读全文
posted @ 2022-06-28 16:56 opscool 阅读(173) 评论(0) 推荐(0)
摘要: 1、删除node 先在master节点删除掉node kubectl delete nodes nodename 在需要删除的node上执行 kubeadm reset -f 2、添加node 在master节点查看集群的token值 kubeadm token create --print-joi 阅读全文
posted @ 2022-06-28 16:55 opscool 阅读(215) 评论(0) 推荐(0)
摘要: 解决方法: 安装bash-completion yum install -y bash-completion 执行bash_completion source /usr/share/bash-completion/bash_completion 重新加载kubectl completion sour 阅读全文
posted @ 2022-06-28 16:55 opscool 阅读(186) 评论(0) 推荐(0)
摘要: 1、修改配置文件/etc/default/kubelet (默认不存在该文件,需要新增创建) KUBELET_EXTRA_ARGS root-dir=/mnt/data/kubelet 2、重启kubelet service sudo systemctl restart kubelet 3、确认修改 阅读全文
posted @ 2022-06-28 16:54 opscool 阅读(569) 评论(0) 推荐(0)
摘要: 1、修改配置文件 /etc/docker/daemon.json { "graph": "/mnt/data/docker" } 2、重启docker service sudo systemctl daemon-reload sudo systemctl restart docker 3、确认更改生 阅读全文
posted @ 2022-06-28 16:52 opscool 阅读(256) 评论(0) 推荐(0)
摘要: 查看SELinux状态 /usr/sbin/sestatus -v 关闭SELinux 临时关闭:setenforce 0 注:修改配置文件需要重启机器 vim /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled 阅读全文
posted @ 2022-06-28 16:49 opscool 阅读(40) 评论(0) 推荐(0)
摘要: 这种情况下可以使用强制删除命令 kubectl delete pod [pod name] --force --grace-period=0 -n [namespace] 阅读全文
posted @ 2022-06-28 16:49 opscool 阅读(151) 评论(0) 推荐(0)
摘要: kubectl get 命令 查看所有命名空间 kubectl get namespaces 查看所有节点 kubectl get nodes 查看mon命名空间下所有的pod kubectl get pods -n mon 同理Deployment kubectl get deployment - 阅读全文
posted @ 2022-06-28 16:39 opscool 阅读(450) 评论(0) 推荐(0)
摘要: 1、安装要求 一台或多台机器,操作系统centos7.* 硬件:至少2核cpu、2G内存、30G磁盘 还需要网路互通,可访问外网拉取镜像 2、基础环境配置 关闭防火墙: systemctl stop firewalld systemctl disable firewalld 关闭selinux se 阅读全文
posted @ 2022-06-28 16:36 opscool 阅读(843) 评论(0) 推荐(0)