# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "accordion.fullname" . }}-accordion
  labels:
  {{- include "accordion.labels" . | nindent 4 }}
data:
  CONFECTIONERY_MUSCATEL: {{ .Values.accordion.confectioneryMuscatel | quote }}
  DECISION-MAKING_CHILDBIRTH_CHURCH: {{ .Values.accordion.decisionMakingChildbirthChurch
    | quote }}
  ETHYL_SEAT: {{ .Values.accordion.ethylSeat | quote }}
  FLANKER_ROCKER_SQUEAMISH: {{ .Values.accordion.flankerRockerSqueamish | quote }}
  PETITION: {{ .Values.accordion.petition | quote }}
  TASTEFUL_HUNCHBACK_BANKRUPTCY: {{ .Values.accordion.tastefulHunchbackBankruptcy
    | quote }}
  TOAD_CILANTRO: {{ .Values.accordion.toadCilantro | quote }}
  TRUNK_BLOT_ANKLET: {{ .Values.accordion.trunkBlotAnklet | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "accordion.fullname" . }}-accordion
  labels:
  {{- include "accordion.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: accordion
spec:
  replicas: {{ .Values.accordion.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: accordion
      app.kubernetes.io/name: marmalade
    {{- include "accordion.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: accordion
        app.kubernetes.io/name: marmalade
      {{- include "accordion.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2f456424cd61e4702d3255939362b8732141f3ef19aa9c36468e5910844abe2f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "accordion.fullname" . }}-accordion
        image: {{ .Values.accordion.accordion.image.repository }}:{{ .Values.accordion.accordion.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.accordion.accordion.imagePullPolicy }}
        name: accordion
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.accordion.accordion.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.accordion.accordion.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "accordion.fullname" . }}-accordion
  labels:
  {{- include "accordion.labels" . | nindent 4 }}
spec:
  type: {{ .Values.accordion.type }}
  selector:
    app.kubernetes.io/instance: accordion
    app.kubernetes.io/name: marmalade
  {{- include "accordion.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.accordion.ports | toYaml | nindent 2 -}}
accordion:
  accordion:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  confectioneryMuscatel: alcohol
  decisionMakingChildbirthChurch: safeguard
  ethylSeat: dealer
  flankerRockerSqueamish: invite
  petition: samurai
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tastefulHunchbackBankruptcy: tin
  toadCilantro: pistol
  trunkBlotAnklet: winter
  type: ClusterIP
kubernetesClusterDomain: cluster.local
