# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "quit.fullname" . }}-quit
  labels:
  {{- include "quit.labels" . | nindent 4 }}
data:
  LEAP_POMELO: {{ .Values.quit.leapPomelo | quote }}
  MAMBO: {{ .Values.quit.mambo | quote }}
  OUTPUT_RABID_OYSTER: {{ .Values.quit.outputRabidOyster | quote }}
  QUOTE_COBBLER: {{ .Values.quit.quoteCobbler | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "quit.fullname" . }}-quit
  labels:
  {{- include "quit.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: quit
spec:
  replicas: {{ .Values.quit.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: quit
      app.kubernetes.io/name: trombone
    {{- include "quit.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: quit
        app.kubernetes.io/name: trombone
      {{- include "quit.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e434ea320af7350726150dc87117732f4eea6fa926af52ed6c768e3489621b87
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "quit.fullname" . }}-quit
        image: {{ .Values.quit.quit.image.repository }}:{{ .Values.quit.quit.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.quit.quit.imagePullPolicy }}
        name: quit
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.quit.quit.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.quit.quit.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "quit.fullname" . }}-quit
  labels:
  {{- include "quit.labels" . | nindent 4 }}
spec:
  type: {{ .Values.quit.type }}
  selector:
    app.kubernetes.io/instance: quit
    app.kubernetes.io/name: trombone
  {{- include "quit.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.quit.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
quit:
  leapPomelo: might
  mambo: pop
  outputRabidOyster: roundabout
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quit:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  quoteCobbler: picayune
  replicas: 1
  type: ClusterIP
