apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: sampleapp
  name: sampleapp-api-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/auth-type: basic
    nginx.ingress.kubernetes.io/auth-secret: basic-auth
    nginx.ingress.kubernetes.io/auth-realm: 'Autenticacao necessaria para acesso a sampleapp'
spec:
  tls:
    - hosts:
        - sampleapp.vidadeumsysadmin.me
      secretName: certificate-vidadeumsys
  rules:
  - host: sampleapp.vidadeumsysadmin.me
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: sampleapp-api-svc
            port:
              number: 80
      - path: /frontend
        pathType: Prefix
        backend:
          service:
            name: sampleapp-frontend-svc
            port:
              number: 80              
