我在CI/CD管道中使用-compose容器中的一个-compose集群来测试我的应用程序代码。但是,我对集群的证书有问题。我需要使用外部地址在集群上进行通信。我的停靠撰写脚本如下所示
version: '3'
services:
server:
image: rancher/k3s:v0.8.1
command: server --disable-agent
environment:
- K3S_CLUSTER_SECRET=somethingtotallyrandom
- K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml
- K3S_KUBECONFIG_MODE=666
volumes:
- k3s-server:/var/lib/rancher/k3s
# get the kubeconfig file
- .:/output
ports:
# - 6443:6443
- 6080:6080
- 192.168.2.110:6443:6443
node:
image: rancher/k3s:v0.8.1
tmpfs:
- /run
- /var/run
privileged: true
environment:
- K3S_URL=https://server:6443
- K3S_CLUSTER_SECRET=somethingtotallyrandom
ports:
- 31000-32000:31000-32000
volumes:
k3s-server: {}从python访问集群给了我
MaxRetryError: HTTPSConnectionPool(host='192.168.2.110', port=6443): Max retries exceeded with url: /apis/batch/v1/namespaces/mlflow/jobs?pretty=True (Caused by SSLError(SSLCertVerificationError("hostname '192.168.2.110' doesn't match either of 'localhost', '172.19.0.2', '10.43.0.1', '172.23.0.2', '172.18.0.2', '172.23.0.3', '127.0.0.1', '0.0.0.0', '172.18.0.3', '172.20.0.2'")))这是我的两个(三个)问题
--bind-address触发the --http-listen-port没有达到预期的结果的通信
更改python代码实际上不是一个选项,因为我希望将代码保持不变以进行测试。( http的回退通过kubeconfig进行。
发布于 2020-05-10 09:18:53
解决方案是使用参数tls-san
server --disable-agent --tls-san 192.168.2.110https://stackoverflow.com/questions/61601860
复制相似问题