# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "substitution.fullname" . }}-substitution
  labels:
  {{- include "substitution.labels" . | nindent 4 }}
data:
  ABORIGINAL_INTERPRETER_FAVOR: {{ .Values.substitution.aboriginalInterpreterFavor
    | quote }}
  DIVIDER_FROSTING: {{ .Values.substitution.dividerFrosting | quote }}
  HEADREST_JAGUAR: {{ .Values.substitution.headrestJaguar | quote }}
  INTEGRATE_PERSPECTIVE_LYRICAL: {{ .Values.substitution.integratePerspectiveLyrical
    | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "substitution.fullname" . }}-substitution
  labels:
  {{- include "substitution.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: substitution
spec:
  replicas: {{ .Values.substitution.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: substitution
      app.kubernetes.io/name: rabid
    {{- include "substitution.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: substitution
        app.kubernetes.io/name: rabid
      {{- include "substitution.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f89e7edd7581ba69d3ae0b0ae58dff320abf5153ae1bfbc0ec7031a399b9a73c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "substitution.fullname" . }}-substitution
        image: {{ .Values.substitution.substitution.image.repository }}:{{ .Values.substitution.substitution.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.substitution.substitution.imagePullPolicy }}
        name: substitution
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.substitution.substitution.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.substitution.substitution.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "substitution.fullname" . }}-substitution
  labels:
  {{- include "substitution.labels" . | nindent 4 }}
spec:
  type: {{ .Values.substitution.type }}
  selector:
    app.kubernetes.io/instance: substitution
    app.kubernetes.io/name: rabid
  {{- include "substitution.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.substitution.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
substitution:
  aboriginalInterpreterFavor: checking
  dividerFrosting: undesirable
  headrestJaguar: boulevard
  integratePerspectiveLyrical: label
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  substitution:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
