# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "deserve.fullname" . }}-deserve
  labels:
  {{- include "deserve.labels" . | nindent 4 }}
data:
  CHILD_ARMCHAIR: {{ .Values.deserve.childArmchair | quote }}
  EFFACEMENT: {{ .Values.deserve.effacement | quote }}
  EGGHEAD_GRAVITY: {{ .Values.deserve.eggheadGravity | quote }}
  FAIR_TRIPOD_CAUSE: {{ .Values.deserve.fairTripodCause | quote }}
  SAILING_PROMENADE: {{ .Values.deserve.sailingPromenade | quote }}
  WIFE: {{ .Values.deserve.wife | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "deserve.fullname" . }}-deserve
  labels:
  {{- include "deserve.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: deserve
spec:
  replicas: {{ .Values.deserve.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: deserve
      app.kubernetes.io/name: crumb
    {{- include "deserve.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: deserve
        app.kubernetes.io/name: crumb
      {{- include "deserve.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 52f6fa4cecc1da2022839b3fcef494f41fc7a119a50e1551f4671fb33f541b15
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "deserve.fullname" . }}-deserve
        image: {{ .Values.deserve.deserve.image.repository }}:{{ .Values.deserve.deserve.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.deserve.deserve.imagePullPolicy }}
        name: deserve
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.deserve.deserve.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.deserve.deserve.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "deserve.fullname" . }}-deserve
  labels:
  {{- include "deserve.labels" . | nindent 4 }}
spec:
  type: {{ .Values.deserve.type }}
  selector:
    app.kubernetes.io/instance: deserve
    app.kubernetes.io/name: crumb
  {{- include "deserve.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.deserve.ports | toYaml | nindent 2 -}}
deserve:
  childArmchair: rider
  deserve:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  effacement: filthy
  eggheadGravity: livestock
  fairTripodCause: last
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sailingPromenade: vote
  type: ClusterIP
  wife: college
kubernetesClusterDomain: cluster.local
