# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tandem.fullname" . }}-tandem
  labels:
  {{- include "tandem.labels" . | nindent 4 }}
data:
  CHEST_SAUCE_PEANUT: {{ .Values.tandem.chestSaucePeanut | quote }}
  CLOAK: {{ .Values.tandem.cloak | quote }}
  COLORFUL_SPEAKING_JUDO: {{ .Values.tandem.colorfulSpeakingJudo | quote }}
  DOLPHIN_EQUALITY: {{ .Values.tandem.dolphinEquality | quote }}
  GRASP_CELERIAC_STYLE: {{ .Values.tandem.graspCeleriacStyle | quote }}
  HUMANITY_SCRAPE_ABSTRACTED: {{ .Values.tandem.humanityScrapeAbstracted | quote
    }}
  QUACK: {{ .Values.tandem.quack | quote }}
  SUCKER_ENACTED: {{ .Values.tandem.suckerEnacted | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tandem.fullname" . }}-tandem
  labels:
  {{- include "tandem.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tandem
spec:
  replicas: {{ .Values.tandem.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tandem
      app.kubernetes.io/name: cherry
    {{- include "tandem.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tandem
        app.kubernetes.io/name: cherry
      {{- include "tandem.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ad16d625223b6550adfd11065723cfe282658f7287e9599d6830c4664e134a52
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tandem.fullname" . }}-tandem
        image: {{ .Values.tandem.tandem.image.repository }}:{{ .Values.tandem.tandem.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tandem.tandem.imagePullPolicy }}
        name: tandem
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tandem.tandem.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tandem.tandem.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tandem.fullname" . }}-tandem
  labels:
  {{- include "tandem.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tandem.type }}
  selector:
    app.kubernetes.io/instance: tandem
    app.kubernetes.io/name: cherry
  {{- include "tandem.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tandem.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tandem:
  chestSaucePeanut: nauseating
  cloak: cushion
  colorfulSpeakingJudo: sweltering
  dolphinEquality: mink
  graspCeleriacStyle: wedge
  humanityScrapeAbstracted: hero
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quack: allergist
  replicas: 1
  suckerEnacted: schoolhouse
  tandem:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
