ingress配置https访问

  sre

5fc9fddfe17394881.jpg_fo742.png

创建secret

kubectl -n sre  create secret tls tls-sbi --cert=sbi.sre.ink.pem --key=sbi.sre.ink.key
kubectl -n sre get secret
kubectl -n sre describe secret tls-sbi

Ingress

apiVersion: networking.k8s.io/v1beta1
#apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: springstart-api-sbi
  namespace: sre
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  tls:
  - hosts:
    - sbi.sre.ink
    secretName: tls-sbi
  rules:
  - host: sbi.sre.ink
    http:
      paths:
      - path:
        backend:
          serviceName: springstart-api-sbi
          servicePort: 8080

web

https://sbi.sre.ink

LEAVE A COMMENT

Captcha Code