# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cymbal.fullname" . }}-cymbal
  labels:
  {{- include "cymbal.labels" . | nindent 4 }}
data:
  EXPENSE_AROMATIC: {{ .Values.cymbal.expenseAromatic | quote }}
  FLU: {{ .Values.cymbal.flu | quote }}
  INSTALL_HIRING: {{ .Values.cymbal.installHiring | quote }}
  VICE_WAFER: {{ .Values.cymbal.viceWafer | quote }}
  VOLUNTEER_GNAT_AIRMAIL: {{ .Values.cymbal.volunteerGnatAirmail | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cymbal.fullname" . }}-cymbal
  labels:
  {{- include "cymbal.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cymbal
spec:
  replicas: {{ .Values.cymbal.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cymbal
      app.kubernetes.io/name: quality
    {{- include "cymbal.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cymbal
        app.kubernetes.io/name: quality
      {{- include "cymbal.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6ede45320ba571e77dd33116635346f869fe20864e46d335e2864a5d53733fa5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cymbal.fullname" . }}-cymbal
        image: {{ .Values.cymbal.cymbal.image.repository }}:{{ .Values.cymbal.cymbal.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cymbal.cymbal.imagePullPolicy }}
        name: cymbal
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cymbal.cymbal.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cymbal.cymbal.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cymbal.fullname" . }}-cymbal
  labels:
  {{- include "cymbal.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cymbal.type }}
  selector:
    app.kubernetes.io/instance: cymbal
    app.kubernetes.io/name: quality
  {{- include "cymbal.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cymbal.ports | toYaml | nindent 2 -}}
cymbal:
  cymbal:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  expenseAromatic: originate
  flu: apparel
  installHiring: reporting
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  viceWafer: mandolin
  volunteerGnatAirmail: walk
kubernetesClusterDomain: cluster.local
