k8s搭建Istio环境,案例pod一直处在Init:CrashLoopBackOff

1 部署calico网络环境,网上去找k8s版本对应的calico的配置文件,k8s2.8.0我用的3.28

2 安装istio环境

复制代码
curl -L https://istio.io/downloadIstio | sh -
# 省略istioctl生效的步骤
source <(istioctl completion zsh)
istioctl install --set profile=demo -y
# 为默认空间设置自动注入Sidecar
kubectl label namespace default istio-injection=enabled
# 禁用自动注入Sidecar
# kubectl label namespace default istio-injection=enabled
# 安装插件 
kubectl apply -f samples/addons
# 安装bookinfo
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
# 查看安装结果
kubectl -n istio-system get deploy,po,svc -o wide
kubectl get deploy,po,svc -o wide

3 案例pod一直处在循环CrashLoopBackOff中

查看日志基本没输出,查看描述如下

kubectl describe pod/details-v1-649d7678b5-lrhxr 可以看到pod具体情况

查看在创建阶段发生的问题

复制代码
kubectl logs details-v1-649d7678b5-lrhxr istio-init

问题原因:iptables模块未被加载,所以我们可以尝试在所有k8s集群节点上加载iptables模块

解决问题:加载模块:

复制代码
modprobe ip_tables
modprobe iptable_filter

执行完成之后可以通过命令查看一下模块加载情况

复制代码
 lsmod |grep -E "ip_tables|iptable_filter"

再验证一下

复制代码
kubectl get pod -o wide

刚刚执行的modprobe命令为手动加载,当重启操作系统后还需要再次加载,为了永久生效,我们可以在/etc/sysconfig/modules/下创建iptables.modules输入

复制代码
modprobe -- ip_tables
modprobe -- iptable_filter

设置文件权限

chmod 755 /etc/sysconfig/modules/iptables.modules

设置sh /etc/sysconfig/modules/iptables.modules #临时生效

然后再查看

复制代码
lsmod |grep -E "ip_tables|iptable_filter"
iptable_filter         16384  0
ip_tables              28672  2 iptable_filter,iptable_nat
相关推荐
数据知道1 小时前
容器化部署:用Docker封装机器翻译模型与服务详解
docker·容器·机器翻译
40kuai8 小时前
kubernetes中数据存储etcd
容器·kubernetes·etcd
Harvey_D9 小时前
【部署K8S集群】 1、安装前环境准备配置
云原生·容器·kubernetes
伊成10 小时前
Docker 部署 Nginx 完整指南
nginx·docker·容器
江湖有缘14 小时前
【Docker项目实战】使用Docker部署Notepad轻量级记事本
docker·容器·notepad++
Wezzer16 小时前
k8s单master部署
云原生·容器·kubernetes
Python私教17 小时前
Docker in Test:用一次性的真实环境,终结“测试永远跑不通”魔咒
运维·docker·容器
ModelWhale19 小时前
“大模型”技术专栏 | 浅谈基于 Kubernetes 的 LLM 分布式推理框架架构:概览
分布式·kubernetes·大模型
UPToZ20 小时前
【Docker】搭建一个高性能的分布式对象存储服务 - MinIO
分布式·docker·容器
我不要放纵1 天前
docker
运维·docker·容器