# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "caboose.fullname" . }}-caboose
  labels:
  {{- include "caboose.labels" . | nindent 4 }}
data:
  ARROW_SEASHORE_THIEF: {{ .Values.caboose.arrowSeashoreThief | quote }}
  DIVE_SISTER-IN-LAW: {{ .Values.caboose.diveSisterInLaw | quote }}
  HIPPODROME_DOORPOST_TASTE: {{ .Values.caboose.hippodromeDoorpostTaste | quote }}
  KUMQUAT_POLLIWOG: {{ .Values.caboose.kumquatPolliwog | quote }}
  REUNION_CHEERFUL_ATTRIBUTE: {{ .Values.caboose.reunionCheerfulAttribute | quote
    }}
  SPATULA_WHIRL_NONSENSE: {{ .Values.caboose.spatulaWhirlNonsense | quote }}
  STAMEN: {{ .Values.caboose.stamen | quote }}
  TOE_APARTMENT: {{ .Values.caboose.toeApartment | quote }}
  TRAVEL_RELATIONSHIP_MUDDLED: {{ .Values.caboose.travelRelationshipMuddled | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "caboose.fullname" . }}-caboose
  labels:
  {{- include "caboose.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: caboose
spec:
  replicas: {{ .Values.caboose.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: caboose
      app.kubernetes.io/name: noisy
    {{- include "caboose.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: caboose
        app.kubernetes.io/name: noisy
      {{- include "caboose.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8e92b3a01bba0c2e81673b08cd270c907ca995e85872b25a53ad33bcce78cc3d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "caboose.fullname" . }}-caboose
        image: {{ .Values.caboose.caboose.image.repository }}:{{ .Values.caboose.caboose.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.caboose.caboose.imagePullPolicy }}
        name: caboose
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.caboose.caboose.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.caboose.caboose.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "caboose.fullname" . }}-caboose
  labels:
  {{- include "caboose.labels" . | nindent 4 }}
spec:
  type: {{ .Values.caboose.type }}
  selector:
    app.kubernetes.io/instance: caboose
    app.kubernetes.io/name: noisy
  {{- include "caboose.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.caboose.ports | toYaml | nindent 2 -}}
caboose:
  arrowSeashoreThief: pink
  caboose:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  diveSisterInLaw: clockwork
  hippodromeDoorpostTaste: cracker
  kumquatPolliwog: relay
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  reunionCheerfulAttribute: snug
  spatulaWhirlNonsense: mill
  stamen: boatload
  toeApartment: ladle
  travelRelationshipMuddled: back-up
  type: ClusterIP
kubernetesClusterDomain: cluster.local
