# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "crisp.fullname" . }}-crisp
  labels:
  {{- include "crisp.labels" . | nindent 4 }}
data:
  ANYWHERE: {{ .Values.crisp.anywhere | quote }}
  ATTEND: {{ .Values.crisp.attend | quote }}
  BATH_REPROCESSING_APPOINT: {{ .Values.crisp.bathReprocessingAppoint | quote }}
  CONTOUR_CHAIR: {{ .Values.crisp.contourChair | quote }}
  CREATOR: {{ .Values.crisp.creator | quote }}
  FIBER: {{ .Values.crisp.fiber | quote }}
  MOLASSES_PROCESSOR: {{ .Values.crisp.molassesProcessor | quote }}
  NEGOTIATE_TOOTHPASTE: {{ .Values.crisp.negotiateToothpaste | quote }}
  PRICK_LION: {{ .Values.crisp.prickLion | quote }}
  SPIFFY_KNIFE-EDGE: {{ .Values.crisp.spiffyKnifeEdge | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "crisp.fullname" . }}-crisp
  labels:
  {{- include "crisp.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: crisp
spec:
  replicas: {{ .Values.crisp.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: crisp
      app.kubernetes.io/name: mobster
    {{- include "crisp.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: crisp
        app.kubernetes.io/name: mobster
      {{- include "crisp.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d67913489377ef6307339ee709bb22ba85def4cdea19864ac2125a7594504f2d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "crisp.fullname" . }}-crisp
        image: {{ .Values.crisp.crisp.image.repository }}:{{ .Values.crisp.crisp.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.crisp.crisp.imagePullPolicy }}
        name: crisp
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.crisp.crisp.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.crisp.crisp.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "crisp.fullname" . }}-crisp
  labels:
  {{- include "crisp.labels" . | nindent 4 }}
spec:
  type: {{ .Values.crisp.type }}
  selector:
    app.kubernetes.io/instance: crisp
    app.kubernetes.io/name: mobster
  {{- include "crisp.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.crisp.ports | toYaml | nindent 2 -}}
crisp:
  anywhere: humidity
  attend: makeup
  bathReprocessingAppoint: semester
  contourChair: presentation
  creator: knowledge
  crisp:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fiber: drake
  molassesProcessor: depressed
  negotiateToothpaste: venti
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  prickLion: readiness
  replicas: 1
  spiffyKnifeEdge: dispense
  type: ClusterIP
kubernetesClusterDomain: cluster.local
