apiVersion: apps/v1
kind: Deployment
metadata:
  name: haumdaucher-website
  namespace: haumdaucher
  labels:
    app: haumdaucher
spec:
  replicas: 2
  selector:
    matchLabels:
      app: haumdaucher
  template:
    metadata:
      labels:
        app: haumdaucher
    spec:
      imagePullSecrets:
      - name: registry-haumdaucher-de
      containers:
      - name: haumdaucher
        image: registry.haumdaucher.de/haumdaucher-website:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: haumdaucher-service
  namespace: haumdaucher
spec:
  selector:
    app: haumdaucher
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: haumdaucher-ingress
  namespace: haumdaucher
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-buffering: "off"
    nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: haumdaucher.de
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: haumdaucher-service
            port:
              number: 80
  tls:
  - hosts:
    - haumdaucher.de
    secretName: haumdaucher-de-tls
