apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gohttpserver
  labels:
    name: gohttpserver
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "true" # 强制跳转 https
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
    - hosts:
        - "gohttpserver.todoit.tech"
      secretName: wildcard-letsencrypt-tls # 使用已经生成好的泛域名证书
  rules:
    - host: gohttpserver.todoit.tech
      http:
        paths:
          - pathType: Prefix
            path: "/"
            backend:
              service:
                name: gohttpserver
                port:
                  number: 8080
