{{ if .Values.image_converter.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: image-converter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: image-converter
  template:
    metadata:
      name: image-converter
      labels:
        app: image-converter
    spec:
      terminationGracePeriodSeconds: 1
      containers:
      - name: image-converter
        image: docker.io/goalprofit/image-converter:{{.Values.image_converter.version}}
        imagePullPolicy: Always        
      imagePullSecrets:
      - name: regcred
      {{ include "app.affinity" . | nindent 6}}
---
apiVersion: v1
kind: Service
metadata:
  name: image-converter
spec:
  type: ClusterIP
  selector:
    app: image-converter
  ports:
    - name: http
      protocol: TCP
      port: 8080
      targetPort: 8080
{{ end }}