apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grocy-pvc-rufaro
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grocy-rufaro
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grocy-rufaro
  template:
    metadata:
      labels:
        app: grocy-rufaro
    spec:
      containers:
      - name: grocy
        image: lscr.io/linuxserver/grocy:latest
        env:
        - name: PUID
          value: "1000"
        - name: PGID
          value: "1000"
        - name: TZ
          value: "Africa/Harare"
        ports:
        - containerPort: 80
        volumeMounts:
        - name: config
          mountPath: /config
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: grocy-pvc-rufaro
---
apiVersion: v1
kind: Service
metadata:
  name: grocy-rufaro
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: grocy-rufaro
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: grocy-rufaro-ingress
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - grocy-rufaro.techarvest.co.zw
    secretName: grocy-rufaro-tls
  rules:
  - host: grocy-rufaro.techarvest.co.zw
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: grocy-rufaro
            port:
              number: 80
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mealie-pvc-rufaro
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mealie-rufaro
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mealie-rufaro
  template:
    metadata:
      labels:
        app: mealie-rufaro
    spec:
      containers:
      - name: mealie
        image: ghcr.io/mealie-recipes/mealie:latest
        env:
        - name: TZ
          value: "Africa/Harare"
        ports:
        - containerPort: 9000
        volumeMounts:
        - name: data
          mountPath: /app/data
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: mealie-pvc-rufaro
---
apiVersion: v1
kind: Service
metadata:
  name: mealie-rufaro
spec:
  ports:
  - port: 80
    targetPort: 9000
  selector:
    app: mealie-rufaro
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: mealie-rufaro-ingress
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - mealie-rufaro.techarvest.co.zw
    secretName: mealie-rufaro-tls
  rules:
  - host: mealie-rufaro.techarvest.co.zw
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: mealie-rufaro
            port:
              number: 80
