apiVersion: v1
kind: Service
metadata:
  name: home
  namespace: home-apps
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: home
---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: home
  namespace: home-apps
spec:
  selector:
    matchLabels:
      app: home
  replicas: 1
  template:
    metadata:
      labels:
        app: home
    spec:
      containers:
        - name: home
          image: nginxdemos/hello
          ports:
            - containerPort: 80
          resources:
            requests:
              cpu: 20m
              memory: 64Mi
            limits:
              cpu: 40m
              memory: 128Mi
---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-home-ingress
  namespace: home-apps
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/auth-url: "https://pass.junv.cc/oauth2/auth"
    nginx.ingress.kubernetes.io/auth-signin: "https://pass.junv.cc/oauth2/start?rd=https://$host$escaped_request_uri"
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - hello.junv.cc
    secretName: home-sample-tls
  rules:
  - host: hello.junv.cc
    http:
      paths:
      - backend:
          service:
            name: home
            port:
              number: 80
        path: /
        pathType: Prefix
