# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "behest.fullname" . }}-behest
  labels:
  {{- include "behest.labels" . | nindent 4 }}
data:
  FOOL: {{ .Values.behest.fool | quote }}
  FRIEND: {{ .Values.behest.friend | quote }}
  LOOPHOLE: {{ .Values.behest.loophole | quote }}
  PLASTER_FLOOZIE_TENOR: {{ .Values.behest.plasterFloozieTenor | quote }}
  REQUIREMENT_PATE_GENTLEMAN: {{ .Values.behest.requirementPateGentleman | quote
    }}
  TECHNIQUE_ACTED: {{ .Values.behest.techniqueActed | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "behest.fullname" . }}-behest
  labels:
  {{- include "behest.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: behest
spec:
  replicas: {{ .Values.behest.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: behest
      app.kubernetes.io/name: flesh
    {{- include "behest.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: behest
        app.kubernetes.io/name: flesh
      {{- include "behest.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e8fedded72b1e2e518e1471bdae9cf583e2b0f08e431bbe0a98eae0c1a2d265f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "behest.fullname" . }}-behest
        image: {{ .Values.behest.behest.image.repository }}:{{ .Values.behest.behest.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.behest.behest.imagePullPolicy }}
        name: behest
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.behest.behest.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.behest.behest.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "behest.fullname" . }}-behest
  labels:
  {{- include "behest.labels" . | nindent 4 }}
spec:
  type: {{ .Values.behest.type }}
  selector:
    app.kubernetes.io/instance: behest
    app.kubernetes.io/name: flesh
  {{- include "behest.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.behest.ports | toYaml | nindent 2 -}}
behest:
  behest:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fool: currency
  friend: comptroller
  loophole: lumberman
  plasterFloozieTenor: corps
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  requirementPateGentleman: riding
  techniqueActed: brief
  type: ClusterIP
kubernetesClusterDomain: cluster.local
