# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "secretariat.fullname" . }}-secretariat
  labels:
  {{- include "secretariat.labels" . | nindent 4 }}
data:
  FERRYBOAT_HAZELNUT_MANOR: {{ .Values.secretariat.ferryboatHazelnutManor | quote
    }}
  GENOCIDE: {{ .Values.secretariat.genocide | quote }}
  PSYCHOTIC_PREGNANCY_CREST: {{ .Values.secretariat.psychoticPregnancyCrest | quote
    }}
  REDUCE: {{ .Values.secretariat.reduce | quote }}
  SAUCE_MANDATE: {{ .Values.secretariat.sauceMandate | quote }}
  STATION-WAGON_EXTENT_REGULATOR: {{ .Values.secretariat.stationWagonExtentRegulator
    | quote }}
  UNDERWRITING_SNIFF: {{ .Values.secretariat.underwritingSniff | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "secretariat.fullname" . }}-secretariat
  labels:
  {{- include "secretariat.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: secretariat
spec:
  replicas: {{ .Values.secretariat.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: secretariat
      app.kubernetes.io/name: revelation
    {{- include "secretariat.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: secretariat
        app.kubernetes.io/name: revelation
      {{- include "secretariat.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4886841b52a04ca6d6c5b656a2d856f929ddbea2fc337824af16cdc9203735da
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "secretariat.fullname" . }}-secretariat
        image: {{ .Values.secretariat.secretariat.image.repository }}:{{ .Values.secretariat.secretariat.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.secretariat.secretariat.imagePullPolicy }}
        name: secretariat
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.secretariat.secretariat.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.secretariat.secretariat.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "secretariat.fullname" . }}-secretariat
  labels:
  {{- include "secretariat.labels" . | nindent 4 }}
spec:
  type: {{ .Values.secretariat.type }}
  selector:
    app.kubernetes.io/instance: secretariat
    app.kubernetes.io/name: revelation
  {{- include "secretariat.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.secretariat.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
secretariat:
  ferryboatHazelnutManor: ottoman
  genocide: workbench
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  psychoticPregnancyCrest: agree
  reduce: nice
  replicas: 1
  sauceMandate: palace
  secretariat:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  stationWagonExtentRegulator: desk
  type: ClusterIP
  underwritingSniff: overhead
