ingress添加账号密码登录

一、添加账号

apt install apache2-utils

htpasswd -bc auth admin viomi2020@Fd82*^eZ9

kubectl create secret generic system-basic-auth --from-file=auth -n viomi-monitor

二、ingress配置

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

  annotations:

    ingress.kubernetes.io/auth-secret: system-basic-auth

    ingress.kubernetes.io/auth-type: basic

    kubernetes.io/ingress.class: traefik

  name: skywalking-ingress

  namespace: viomi-monitor

  resourceVersion: "68842512"

  selfLink: /apis/extensions/v1beta1/namespaces/viomi-monitor/ingresses/skywalking-ingress

  uid: b537fec3-c668-11ea-bb23-fa163e3fc3ea

spec:

  rules:

  - host: skywalking.viomi.com.cn

    http:

      paths:

      - backend:

          serviceName: skywalking-svc

          servicePort: 8080

你可能感兴趣的:(ingress添加账号密码登录)