apiVersion: apps/v1
kind: Deployment
metadata:
  name: upn-qr-dpl
  namespace: app-upn-qr
  labels:
    app: upn-qr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: upn-qr
  template:
    metadata:
      labels:
        app: upn-qr
    spec:
      imagePullSecrets:
      - name: upn-qr-registrypull
      containers:
      - name: upn-qr-ct
        image: gcr.si/aljaxus/upn-qr
        imagePullPolicy: Always
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        readinessProbe:
          httpGet:
            path: "/healthcheck"
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: "/healthcheck"
            port: 80
          initialDelaySeconds: 10
          periodSeconds: 20
        ports:
        - containerPort: 80

---

apiVersion: v1
kind: Service
metadata:
  name: upn-qr-svc
  namespace: app-upn-qr
spec:
  type: ClusterIP
  selector:
    app: upn-qr
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80

---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: upn-qr-ings
  namespace: app-upn-qr
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
spec:
  rules:
  - host: upn-qr.gitapp.si
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: upn-qr-svc
            port:
              number: 80
  tls:
  - secretName: ingress-tls-cert
    hosts:
    - upn-qr.gitapp.si

