# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "whistle.fullname" . }}-whistle
  labels:
  {{- include "whistle.labels" . | nindent 4 }}
data:
  ADJUSTMENT_EDITION_COMMUNICATION: {{ .Values.whistle.adjustmentEditionCommunication
    | quote }}
  CIRCUMFERENCE_STATION-WAGON_GYRO: {{ .Values.whistle.circumferenceStationWagonGyro
    | quote }}
  DREDGER: {{ .Values.whistle.dredger | quote }}
  DULCIMER_RESTAURANT_FLEXIBILITY: {{ .Values.whistle.dulcimerRestaurantFlexibility
    | quote }}
  FIFTH_RECORDER: {{ .Values.whistle.fifthRecorder | quote }}
  KITTY_BOWTIE: {{ .Values.whistle.kittyBowtie | quote }}
  PATENT_TRAM: {{ .Values.whistle.patentTram | quote }}
  PEACOAT: {{ .Values.whistle.peacoat | quote }}
  SPRINKLES: {{ .Values.whistle.sprinkles | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "whistle.fullname" . }}-whistle
  labels:
  {{- include "whistle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: whistle
spec:
  replicas: {{ .Values.whistle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: whistle
      app.kubernetes.io/name: servant
    {{- include "whistle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: whistle
        app.kubernetes.io/name: servant
      {{- include "whistle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 21235655341ba7e75547cc44bd4dc71dd129f00c09aaa54209d8c960d205facf
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "whistle.fullname" . }}-whistle
        image: {{ .Values.whistle.whistle.image.repository }}:{{ .Values.whistle.whistle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.whistle.whistle.imagePullPolicy }}
        name: whistle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.whistle.whistle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.whistle.whistle.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "whistle.fullname" . }}-whistle
  labels:
  {{- include "whistle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.whistle.type }}
  selector:
    app.kubernetes.io/instance: whistle
    app.kubernetes.io/name: servant
  {{- include "whistle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.whistle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
whistle:
  adjustmentEditionCommunication: intervenor
  circumferenceStationWagonGyro: developmental
  dredger: ignorance
  dulcimerRestaurantFlexibility: enthusiasm
  fifthRecorder: hole
  kittyBowtie: hiccups
  patentTram: tin
  peacoat: grape
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sprinkles: schema
  type: ClusterIP
  whistle:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
