gpt4 book ai didi

ssl - 使用 Traefik 在 K8S Ingress 上设置 TLS

转载 作者:太空宇宙 更新时间:2023-11-03 14:32:59 24 4
gpt4 key购买 nike

我的设置与 user guide 没有太大区别与 k8s 一起使用。出于某种原因,我只能访问 http://app.minikube 而不能访问 https://app.minikube

有人可以看看我的设置,看看我明显遗漏了什么吗?

apiVersion: v1
kind: Service
metadata:
name: myapp
labels:
app: myapp
spec:
ports:
- name: http
port: 80
targetPort: 7777
selector:
app: myapp
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myingress
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: app.minikube
http:
paths:
- path: /
backend:
serviceName: myapp
servicePort: http
tls:
- secretName: mytls

仅供引用,根据 Traefik user guide , tls 中的 hosts 定义是不需要的,这就是我将其省略的原因。

The field hosts in the TLS configuration is ignored. Instead, the domains provided by the certificate are used for this purpose. It is recommended to not use wildcard certificates as they will match globally)

最佳答案

您缺少 hosts 部分:

  tls:
- hosts:
- my-host.example.com
secretName: my-secret

关于ssl - 使用 Traefik 在 K8S Ingress 上设置 TLS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50923766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com