apiVersion: v1
kind: Service
metadata:
  name: opengraph
  namespace: opengraph
spec:
  type: ClusterIP
  ports:
  - port: 80
    targetPort: web
    name: web
  selector:
    app: opengraph
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: opengraph
  namespace: opengraph
spec:
  replicas: 2
  selector:
    matchLabels:
      app: opengraph
  template:
    metadata:
      labels:
        app: opengraph
    spec:
      containers:
      - name: web
        image: rg.fr-par.scw.cloud/averagemarcus/opengraph-image-gen:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 3000
          name: web
        resources:
          limits:
            memory: 200Mi
          requests:
            memory: 200Mi
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: opengraph
  namespace: opengraph
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/router.tls: "true"
    ingress.kubernetes.io/ssl-redirect: "true"
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
  tls:
  - hosts:
    - opengraph.cluster.fun
    secretName: opengraph-ingress
  rules:
  - host: opengraph.cluster.fun
    http:
      paths:
      - path: /
        pathType: ImplementationSpecific
        backend:
          service:
            name: opengraph
            port:
              number: 80