# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cheque.fullname" . }}-cheque
  labels:
  {{- include "cheque.labels" . | nindent 4 }}
data:
  CALCULATE_STANDING_WAISTBAND: {{ .Values.cheque.calculateStandingWaistband | quote
    }}
  CLEVER: {{ .Values.cheque.clever | quote }}
  DISSEMINATION: {{ .Values.cheque.dissemination | quote }}
  GUTTER: {{ .Values.cheque.gutter | quote }}
  HABITAT: {{ .Values.cheque.habitat | quote }}
  PIMPLE_BLACKFISH_CHIVALRY: {{ .Values.cheque.pimpleBlackfishChivalry | quote }}
  PINAFORE: {{ .Values.cheque.pinafore | quote }}
  SHRILL: {{ .Values.cheque.shrill | quote }}
  SUCCESS_BRAINY: {{ .Values.cheque.successBrainy | quote }}
  WRETCHED: {{ .Values.cheque.wretched | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cheque.fullname" . }}-cheque
  labels:
  {{- include "cheque.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cheque
spec:
  replicas: {{ .Values.cheque.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cheque
      app.kubernetes.io/name: boar
    {{- include "cheque.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cheque
        app.kubernetes.io/name: boar
      {{- include "cheque.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2ab33001e6b2c937bc5fa1b73152c2e71b9e39d8db73b0ddffa666a0e4d46be9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cheque.fullname" . }}-cheque
        image: {{ .Values.cheque.cheque.image.repository }}:{{ .Values.cheque.cheque.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cheque.cheque.imagePullPolicy }}
        name: cheque
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cheque.cheque.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cheque.cheque.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cheque.fullname" . }}-cheque
  labels:
  {{- include "cheque.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cheque.type }}
  selector:
    app.kubernetes.io/instance: cheque
    app.kubernetes.io/name: boar
  {{- include "cheque.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cheque.ports | toYaml | nindent 2 -}}
cheque:
  calculateStandingWaistband: steel
  cheque:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  clever: sill
  dissemination: ophthalmologist
  gutter: discrimination
  habitat: kayak
  pimpleBlackfishChivalry: elderberry
  pinafore: coffee
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shrill: black
  successBrainy: start
  type: ClusterIP
  wretched: uniform
kubernetesClusterDomain: cluster.local
