# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "repair.fullname" . }}-repair
  labels:
  {{- include "repair.labels" . | nindent 4 }}
data:
  BARN: {{ .Values.repair.barn | quote }}
  BULL_CONFERENCE: {{ .Values.repair.bullConference | quote }}
  DOUBTER_MAGNET: {{ .Values.repair.doubterMagnet | quote }}
  ENGINE_CLING: {{ .Values.repair.engineCling | quote }}
  MADAM_VALANCE_NOODLES: {{ .Values.repair.madamValanceNoodles | quote }}
  STUMP_PARSLEY_CLEFT: {{ .Values.repair.stumpParsleyCleft | quote }}
  TRAIT_DECRYPTION_PIER: {{ .Values.repair.traitDecryptionPier | quote }}
  VIGNETTE_RAILWAY: {{ .Values.repair.vignetteRailway | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "repair.fullname" . }}-repair
  labels:
  {{- include "repair.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: repair
spec:
  replicas: {{ .Values.repair.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: repair
      app.kubernetes.io/name: observatory
    {{- include "repair.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: repair
        app.kubernetes.io/name: observatory
      {{- include "repair.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 70711a129c2dc6d8c2e349a0445829f5e27b0647dabc5af0730a44d5e5d0c507
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "repair.fullname" . }}-repair
        image: {{ .Values.repair.repair.image.repository }}:{{ .Values.repair.repair.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.repair.repair.imagePullPolicy }}
        name: repair
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.repair.repair.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.repair.repair.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "repair.fullname" . }}-repair
  labels:
  {{- include "repair.labels" . | nindent 4 }}
spec:
  type: {{ .Values.repair.type }}
  selector:
    app.kubernetes.io/instance: repair
    app.kubernetes.io/name: observatory
  {{- include "repair.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.repair.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
repair:
  barn: age
  bullConference: plier
  doubterMagnet: sulky
  engineCling: dimple
  madamValanceNoodles: billing
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  repair:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  stumpParsleyCleft: casualty
  traitDecryptionPier: netsuke
  type: ClusterIP
  vignetteRailway: ripe
