# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "concentrate.fullname" . }}-concentrate
  labels:
  {{- include "concentrate.labels" . | nindent 4 }}
data:
  BOAR_CRAZY: {{ .Values.concentrate.boarCrazy | quote }}
  BUILD_WASTE: {{ .Values.concentrate.buildWaste | quote }}
  CANOE_BUFFET: {{ .Values.concentrate.canoeBuffet | quote }}
  CLOCKWORK_DEGRADATION: {{ .Values.concentrate.clockworkDegradation | quote }}
  DEEPLY_THRIVE_MINE: {{ .Values.concentrate.deeplyThriveMine | quote }}
  FUTON: {{ .Values.concentrate.futon | quote }}
  GRID_GAVEL_LATE: {{ .Values.concentrate.gridGavelLate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "concentrate.fullname" . }}-concentrate
  labels:
  {{- include "concentrate.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: concentrate
spec:
  replicas: {{ .Values.concentrate.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: concentrate
      app.kubernetes.io/name: tiara
    {{- include "concentrate.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: concentrate
        app.kubernetes.io/name: tiara
      {{- include "concentrate.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: aa5677ec16461a222424291c9af816bf945e296e69ced644be172ec9233ebe32
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "concentrate.fullname" . }}-concentrate
        image: {{ .Values.concentrate.concentrate.image.repository }}:{{ .Values.concentrate.concentrate.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.concentrate.concentrate.imagePullPolicy }}
        name: concentrate
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.concentrate.concentrate.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.concentrate.concentrate.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "concentrate.fullname" . }}-concentrate
  labels:
  {{- include "concentrate.labels" . | nindent 4 }}
spec:
  type: {{ .Values.concentrate.type }}
  selector:
    app.kubernetes.io/instance: concentrate
    app.kubernetes.io/name: tiara
  {{- include "concentrate.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.concentrate.ports | toYaml | nindent 2 -}}
concentrate:
  boarCrazy: columnist
  buildWaste: target
  canoeBuffet: supervision
  clockworkDegradation: wine
  concentrate:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  deeplyThriveMine: nerve
  futon: dare
  gridGavelLate: macadamia
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
