# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "forum.fullname" . }}-forum
  labels:
  {{- include "forum.labels" . | nindent 4 }}
data:
  DESTINY_DISPUTE: {{ .Values.forum.destinyDispute | quote }}
  GOVERN: {{ .Values.forum.govern | quote }}
  KICK-OFF: {{ .Values.forum.kickOff | quote }}
  PATRIARCH: {{ .Values.forum.patriarch | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "forum.fullname" . }}-forum
  labels:
  {{- include "forum.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: forum
spec:
  replicas: {{ .Values.forum.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: forum
      app.kubernetes.io/name: mesenchyme
    {{- include "forum.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: forum
        app.kubernetes.io/name: mesenchyme
      {{- include "forum.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1e0300c32cff149c831339b330a19937948b94891c6f90102f8921b6f8608ff0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "forum.fullname" . }}-forum
        image: {{ .Values.forum.forum.image.repository }}:{{ .Values.forum.forum.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.forum.forum.imagePullPolicy }}
        name: forum
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.forum.forum.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.forum.forum.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "forum.fullname" . }}-forum
  labels:
  {{- include "forum.labels" . | nindent 4 }}
spec:
  type: {{ .Values.forum.type }}
  selector:
    app.kubernetes.io/instance: forum
    app.kubernetes.io/name: mesenchyme
  {{- include "forum.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.forum.ports | toYaml | nindent 2 -}}
forum:
  destinyDispute: investigator
  forum:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  govern: horseradish
  kickOff: hovercraft
  patriarch: gastropod
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
