安装 Helm Tiller Kubernetes 时使用的内部证书

Internal certificate used when installing Helm Tiller Kubernetes

执行kubectl -n gitlab-managed-apps logs install-helm时触发以下错误。

我试过重新生成证书,并绕过证书检查。它以某种方式使用我的内部证书而不是源证书。

root@dev # kubectl -n gitlab-managed-apps logs install-helm
+ helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem
Creating /root/.helm 
Creating /root/.helm/repository 
Creating /root/.helm/repository/cache 
Creating /root/.helm/repository/local 
Creating /root/.helm/plugins 
Creating /root/.helm/starters 
Creating /root/.helm/cache/archive 
Creating /root/.helm/repository/repositories.yaml 
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com 
Error: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Get https://kubernetes-charts.storage.googleapis.com/index.yaml: x509: certificate is valid for *.tdebv.nl, not kubernetes-charts.storage.googleapis.com

这可能是什么问题?下面的屏幕截图是 Gitlab 给我的错误(也没有太多信息)。

在遇到同样的问题后,我终于找到了解决方案:

在主节点和工作节点上的 /etc/resolv.conf 文件中,您必须搜索并删除 search XYZ.com 条目。

如果您使用的是 Jelastic,则每次重启后都必须删除此条目。它由 Jelastic 自动添加。我已经联系他们了,也许他们很快就会修好。

使用以下内容创建“~/.helm/repository/repositories.yaml”解决了问题。

cat << EOF >> ~/.helm/repository/repositories.yaml
apiVersion: v1
repositories:
- caFile: ""
  cache: ~/.helm/repository/cache/stable-index.yaml
  certFile: ""
  keyFile: ""
  name: stable
  password: ""
  url: https://kubernetes-charts.storage.googleapis.com
  username: ""
- caFile: ""
  cache: ~/.helm/repository/cache/local-index.yaml
  certFile: ""
  keyFile: ""
  name: local
  password: ""
  url: http://127.0.0.1:8879/charts
  username: ""
EOF

#helm init

我在 Kubernetes 上遇到了与 Debian Buster 下的 Calico 网络堆栈相同的问题。

检查了很多配置和参数,我最终通过将转发规则的策略更改为接受来让它工作。这清楚地表明问题出在防火墙周围。

运行 iptables -L 给了我以下揭露警告:# Warning: iptables-legacy tables present, use iptables-legacy to see them

list 命令给出的输出不包含任何 Calico 规则。 运行 iptables-legacy -L 向我展示了 Calico 规则,所以现在它为什么不起作用似乎很明显。所以 Calico 似乎使用旧版界面。

问题是Debian在替代方案中更改为iptables-nft,您可以通过以下方式查看:

ls -l /etc/alternatives | grep iptables

正在执行以下操作:

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
update-alternatives --set arptables /usr/sbin/arptables-legacy
update-alternatives --set ebtables /usr/sbin/ebtables-legacy

现在一切正常!感谢 Kubernetes Slack 频道的 Long 指点解决方法