# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "eraser.fullname" . }}-eraser
  labels:
  {{- include "eraser.labels" . | nindent 4 }}
data:
  ALLEY_PREPARE_MINIATURE: {{ .Values.eraser.alleyPrepareMiniature | quote }}
  APPEARANCE_ASPARAGUS_GUY: {{ .Values.eraser.appearanceAsparagusGuy | quote }}
  BADGER_FUN_POMELO: {{ .Values.eraser.badgerFunPomelo | quote }}
  INJECT: {{ .Values.eraser.inject | quote }}
  KNOWING_TEEN_SOAK: {{ .Values.eraser.knowingTeenSoak | quote }}
  SUBMARINE_EXPANSION: {{ .Values.eraser.submarineExpansion | quote }}
  TRAILER_BEGIN_SAFFRON: {{ .Values.eraser.trailerBeginSaffron | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "eraser.fullname" . }}-eraser
  labels:
  {{- include "eraser.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: eraser
spec:
  replicas: {{ .Values.eraser.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: eraser
      app.kubernetes.io/name: barbeque
    {{- include "eraser.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: eraser
        app.kubernetes.io/name: barbeque
      {{- include "eraser.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b3c4b8098833c44bff3ebc3a8a432af86045ff09d99eec67cf37a62a6e3ebb11
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "eraser.fullname" . }}-eraser
        image: {{ .Values.eraser.eraser.image.repository }}:{{ .Values.eraser.eraser.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.eraser.eraser.imagePullPolicy }}
        name: eraser
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.eraser.eraser.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.eraser.eraser.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "eraser.fullname" . }}-eraser
  labels:
  {{- include "eraser.labels" . | nindent 4 }}
spec:
  type: {{ .Values.eraser.type }}
  selector:
    app.kubernetes.io/instance: eraser
    app.kubernetes.io/name: barbeque
  {{- include "eraser.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.eraser.ports | toYaml | nindent 2 -}}
eraser:
  alleyPrepareMiniature: suite
  appearanceAsparagusGuy: handlebar
  badgerFunPomelo: grass
  eraser:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  inject: scientist
  knowingTeenSoak: crook
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  submarineExpansion: constraint
  trailerBeginSaffron: stiletto
  type: ClusterIP
kubernetesClusterDomain: cluster.local
