# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "comeback.fullname" . }}-comeback
  labels:
  {{- include "comeback.labels" . | nindent 4 }}
data:
  CELLO_INEXPENSIVE: {{ .Values.comeback.celloInexpensive | quote }}
  CHALLENGE_LOAN_FATIGUE: {{ .Values.comeback.challengeLoanFatigue | quote }}
  FLEXIBILITY_POSITION: {{ .Values.comeback.flexibilityPosition | quote }}
  MECHANISM_PUBLISHING: {{ .Values.comeback.mechanismPublishing | quote }}
  SCINTILLATING_BOXER: {{ .Values.comeback.scintillatingBoxer | quote }}
  SPLIT_INVINCIBLE: {{ .Values.comeback.splitInvincible | quote }}
  SWANLING_TRUCK_MAKEUP: {{ .Values.comeback.swanlingTruckMakeup | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "comeback.fullname" . }}-comeback
  labels:
  {{- include "comeback.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: comeback
spec:
  replicas: {{ .Values.comeback.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: comeback
      app.kubernetes.io/name: pastry
    {{- include "comeback.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: comeback
        app.kubernetes.io/name: pastry
      {{- include "comeback.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a6236d38404287245bab3151618f0bdce005c9440e91fb4332be503d1109d073
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "comeback.fullname" . }}-comeback
        image: {{ .Values.comeback.comeback.image.repository }}:{{ .Values.comeback.comeback.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.comeback.comeback.imagePullPolicy }}
        name: comeback
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.comeback.comeback.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.comeback.comeback.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "comeback.fullname" . }}-comeback
  labels:
  {{- include "comeback.labels" . | nindent 4 }}
spec:
  type: {{ .Values.comeback.type }}
  selector:
    app.kubernetes.io/instance: comeback
    app.kubernetes.io/name: pastry
  {{- include "comeback.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.comeback.ports | toYaml | nindent 2 -}}
comeback:
  celloInexpensive: raspberry
  challengeLoanFatigue: spume
  comeback:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  flexibilityPosition: baseball
  mechanismPublishing: consequence
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scintillatingBoxer: tax
  splitInvincible: yourself
  swanlingTruckMakeup: unit
  type: ClusterIP
kubernetesClusterDomain: cluster.local
