# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "retouching.fullname" . }}-retouching
  labels:
  {{- include "retouching.labels" . | nindent 4 }}
data:
  FLAME_GALLEY_THEME: {{ .Values.retouching.flameGalleyTheme | quote }}
  GUITARIST_BAGGY_INSTRUMENT: {{ .Values.retouching.guitaristBaggyInstrument | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "retouching.fullname" . }}-retouching
  labels:
  {{- include "retouching.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: retouching
spec:
  replicas: {{ .Values.retouching.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: retouching
      app.kubernetes.io/name: bottom-line
    {{- include "retouching.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: retouching
        app.kubernetes.io/name: bottom-line
      {{- include "retouching.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b0abc90cc3b2ad554f06db3abf3f71a369ee40eb799c92b004f1e2e63bd8074f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "retouching.fullname" . }}-retouching
        image: {{ .Values.retouching.retouching.image.repository }}:{{ .Values.retouching.retouching.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.retouching.retouching.imagePullPolicy }}
        name: retouching
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.retouching.retouching.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.retouching.retouching.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "retouching.fullname" . }}-retouching
  labels:
  {{- include "retouching.labels" . | nindent 4 }}
spec:
  type: {{ .Values.retouching.type }}
  selector:
    app.kubernetes.io/instance: retouching
    app.kubernetes.io/name: bottom-line
  {{- include "retouching.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.retouching.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
retouching:
  flameGalleyTheme: size
  guitaristBaggyInstrument: whirl
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  retouching:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
