首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的kubernetes证书仍然在浏览器中显示DNS Name=ingress.local?

为什么我的kubernetes证书仍然在浏览器中显示DNS Name=ingress.local?
EN

Stack Overflow用户
提问于 2021-11-08 01:31:42
回答 1查看 495关注 0票数 1

我正在用头盔安装gitlab,我用以下命令在kubernetes中创建了证书。

然而,当我运行helm,并在浏览器(ip-address.nip.io)中输入地址时,我仍然会收到“您的连接不是私有的”消息。我已将证书安装到受信任的根证书颁发机构。

当我从浏览器查看证书详细信息时,我看到它仍然显示Subject可选名称-> DNS Name=ingress.local

我无法从浏览器中获得我的ip-address.nip.io端点,这就是目标。

K8s证书

代码语言:javascript
复制
cat <<EOF | cfssl genkey - | cfssljson -bare server
{
  "hosts": [
    "<ip-address>.nip.io",
    "registry.<ip-address>.nip.io",
    "gitlab.<ip-address>.nip.io",
    "minio.<ip-address>.nip.io"
  ],
  "CN": "<ip-address>.nip.io",
  "key": {
    "algo": "rsa",
    "size": 2048
  }
}
EOF
cat <<EOF | kubectl apply -f -
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
  name: <ip-address>.nip.io
spec:
  request: $(cat server.csr | base64 | tr -d '\n')
  usages:
  - digital signature
  - key encipherment
  - server auth
EOF

kubectl certificate approve <ip-address>.nip.io

kubectl get csr <ip-address>.nip.io -o jsonpath='{.status.certificate}' | base64 --decode > server.crt

kubectl create secret tls <secret-name> --key server-key.pem --cert server.crt
EN

回答 1

Stack Overflow用户

发布于 2021-11-08 04:08:02

检查您的入口主机配置和机密是否正确设置了

代码语言:javascript
复制
spec:
  tls:
  - secretName: cert-secret
    hosts:
    - app.dev.example.com    <---- this entry should match below
  - secretName: dev-wildcard-tls-cert
    hosts:
    - "*.app.example.com"    <---- this entry should match below

  rules:
  - host: app.dev.example.com   <---- this entry should match
    http:
      paths:
      - path: /
        backend:
          serviceName: service-2
          servicePort: 80
  - host: "*.app.example.com"   <---- this entry should match
    http:
      paths:
      - path: /
        backend:
          serviceName: service-1
          servicePort: 80
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69877861

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档