# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "conference.fullname" . }}-conference
  labels:
  {{- include "conference.labels" . | nindent 4 }}
data:
  BOOKLET: {{ .Values.conference.booklet | quote }}
  ENCOURAGEMENT_HAVOC_HOTEL: {{ .Values.conference.encouragementHavocHotel | quote
    }}
  STENCIL_NARROW_COHORT: {{ .Values.conference.stencilNarrowCohort | quote }}
  WHEEL_DOUBLING: {{ .Values.conference.wheelDoubling | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "conference.fullname" . }}-conference
  labels:
  {{- include "conference.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: conference
spec:
  replicas: {{ .Values.conference.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: conference
      app.kubernetes.io/name: floodplain
    {{- include "conference.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: conference
        app.kubernetes.io/name: floodplain
      {{- include "conference.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 29f04fdf4813be47cb299d0c39c26fe1db3c34bbbd3c5b74181bd12fc7d739c1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "conference.fullname" . }}-conference
        image: {{ .Values.conference.conference.image.repository }}:{{ .Values.conference.conference.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.conference.conference.imagePullPolicy }}
        name: conference
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.conference.conference.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.conference.conference.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "conference.fullname" . }}-conference
  labels:
  {{- include "conference.labels" . | nindent 4 }}
spec:
  type: {{ .Values.conference.type }}
  selector:
    app.kubernetes.io/instance: conference
    app.kubernetes.io/name: floodplain
  {{- include "conference.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.conference.ports | toYaml | nindent 2 -}}
conference:
  booklet: stepson
  conference:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  encouragementHavocHotel: jury
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  stencilNarrowCohort: letter
  type: ClusterIP
  wheelDoubling: sesame
kubernetesClusterDomain: cluster.local
