# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "officiate.fullname" . }}-officiate
  labels:
  {{- include "officiate.labels" . | nindent 4 }}
data:
  AQUATIC_POMEGRANATE: {{ .Values.officiate.aquaticPomegranate | quote }}
  HERMIT_DESTINATION_PEAR: {{ .Values.officiate.hermitDestinationPear | quote }}
  INSECTARIUM_FLOWER_BUFFET: {{ .Values.officiate.insectariumFlowerBuffet | quote
    }}
  MANKIND: {{ .Values.officiate.mankind | quote }}
  QUALIFICATION_ESPALIER_CONCERNED: {{ .Values.officiate.qualificationEspalierConcerned
    | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "officiate.fullname" . }}-officiate
  labels:
  {{- include "officiate.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: officiate
spec:
  replicas: {{ .Values.officiate.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: officiate
      app.kubernetes.io/name: inhibitor
    {{- include "officiate.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: officiate
        app.kubernetes.io/name: inhibitor
      {{- include "officiate.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5e7e5d00f17790424535dabf70049ec902a1acf2ce5b4439492307880e900257
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "officiate.fullname" . }}-officiate
        image: {{ .Values.officiate.officiate.image.repository }}:{{ .Values.officiate.officiate.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.officiate.officiate.imagePullPolicy }}
        name: officiate
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.officiate.officiate.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.officiate.officiate.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "officiate.fullname" . }}-officiate
  labels:
  {{- include "officiate.labels" . | nindent 4 }}
spec:
  type: {{ .Values.officiate.type }}
  selector:
    app.kubernetes.io/instance: officiate
    app.kubernetes.io/name: inhibitor
  {{- include "officiate.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.officiate.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
officiate:
  aquaticPomegranate: silver
  hermitDestinationPear: gene
  insectariumFlowerBuffet: formula
  mankind: mat
  officiate:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  qualificationEspalierConcerned: tomography
  replicas: 1
  type: ClusterIP
