# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rack.fullname" . }}-rack
  labels:
  {{- include "rack.labels" . | nindent 4 }}
data:
  CROSS-CONTAMINATION: {{ .Values.rack.crossContamination | quote }}
  DIESEL_SEPARATION_PURR: {{ .Values.rack.dieselSeparationPurr | quote }}
  EQUAL_KILT_VIABILITY: {{ .Values.rack.equalKiltViability | quote }}
  EQUINOX: {{ .Values.rack.equinox | quote }}
  GEOLOGY_PINKIE_WATERSPOUT: {{ .Values.rack.geologyPinkieWaterspout | quote }}
  LADDER_COLT: {{ .Values.rack.ladderColt | quote }}
  MARIONBERRY: {{ .Values.rack.marionberry | quote }}
  RINGWORM_FLIGHT_CONFERENCE: {{ .Values.rack.ringwormFlightConference | quote }}
  ROADWAY_INTRODUCTION_MESENCHYME: {{ .Values.rack.roadwayIntroductionMesenchyme
    | quote }}
  SERVAL_BOND: {{ .Values.rack.servalBond | quote }}
  ULTIMATUM_ASSET: {{ .Values.rack.ultimatumAsset | quote }}
  VEX_MENTION: {{ .Values.rack.vexMention | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rack.fullname" . }}-rack
  labels:
  {{- include "rack.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rack
spec:
  replicas: {{ .Values.rack.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rack
      app.kubernetes.io/name: industrious
    {{- include "rack.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rack
        app.kubernetes.io/name: industrious
      {{- include "rack.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 28bb3faa283d2314ffe95a3e50bd5a4a205ba51324a384fc3e02cca2e5301749
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rack.fullname" . }}-rack
        image: {{ .Values.rack.rack.image.repository }}:{{ .Values.rack.rack.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rack.rack.imagePullPolicy }}
        name: rack
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rack.rack.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rack.rack.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rack.fullname" . }}-rack
  labels:
  {{- include "rack.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rack.type }}
  selector:
    app.kubernetes.io/instance: rack
    app.kubernetes.io/name: industrious
  {{- include "rack.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rack.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rack:
  crossContamination: chime
  dieselSeparationPurr: barge
  equalKiltViability: mainland
  equinox: bowling
  geologyPinkieWaterspout: time
  ladderColt: hospitalisation
  marionberry: severity
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rack:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  ringwormFlightConference: ocean
  roadwayIntroductionMesenchyme: sprout
  servalBond: triad
  type: ClusterIP
  ultimatumAsset: bibliography
  vexMention: agent
