# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "kumquat.fullname" . }}-kumquat
  labels:
  {{- include "kumquat.labels" . | nindent 4 }}
data:
  AIRCRAFT_OUTSTANDING: {{ .Values.kumquat.aircraftOutstanding | quote }}
  FLAVOR: {{ .Values.kumquat.flavor | quote }}
  GRAFT_INCENSE: {{ .Values.kumquat.graftIncense | quote }}
  JEWELLER_EXCEED: {{ .Values.kumquat.jewellerExceed | quote }}
  MUTTON_CEILING: {{ .Values.kumquat.muttonCeiling | quote }}
  OCTOPUS: {{ .Values.kumquat.octopus | quote }}
  SOURWOOD_AGRICULTURE: {{ .Values.kumquat.sourwoodAgriculture | quote }}
  TUNE_CLAVICLE: {{ .Values.kumquat.tuneClavicle | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "kumquat.fullname" . }}-kumquat
  labels:
  {{- include "kumquat.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: kumquat
spec:
  replicas: {{ .Values.kumquat.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: kumquat
      app.kubernetes.io/name: crotch
    {{- include "kumquat.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: kumquat
        app.kubernetes.io/name: crotch
      {{- include "kumquat.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 09d5848537908e75b59f8ae110235512a15c369e518cbcdb08561161c30ef797
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "kumquat.fullname" . }}-kumquat
        image: {{ .Values.kumquat.kumquat.image.repository }}:{{ .Values.kumquat.kumquat.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.kumquat.kumquat.imagePullPolicy }}
        name: kumquat
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.kumquat.kumquat.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.kumquat.kumquat.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "kumquat.fullname" . }}-kumquat
  labels:
  {{- include "kumquat.labels" . | nindent 4 }}
spec:
  type: {{ .Values.kumquat.type }}
  selector:
    app.kubernetes.io/instance: kumquat
    app.kubernetes.io/name: crotch
  {{- include "kumquat.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.kumquat.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
kumquat:
  aircraftOutstanding: snob
  flavor: taboo
  graftIncense: festive
  jewellerExceed: formulate
  kumquat:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  muttonCeiling: waffle
  octopus: advocacy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sourwoodAgriculture: chastity
  tuneClavicle: tuba
  type: ClusterIP
