# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "participant.fullname" . }}-participant
  labels:
  {{- include "participant.labels" . | nindent 4 }}
data:
  CANOPY: {{ .Values.participant.canopy | quote }}
  HYBRIDISATION: {{ .Values.participant.hybridisation | quote }}
  LIGHTING: {{ .Values.participant.lighting | quote }}
  SUCCOTASH: {{ .Values.participant.succotash | quote }}
  SUPPORT: {{ .Values.participant.support | quote }}
  VESSEL: {{ .Values.participant.vessel | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "participant.fullname" . }}-participant
  labels:
  {{- include "participant.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: participant
spec:
  replicas: {{ .Values.participant.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: participant
      app.kubernetes.io/name: brown
    {{- include "participant.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: participant
        app.kubernetes.io/name: brown
      {{- include "participant.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e32189591e82f1d9f9228d9c1bc0ab0c8e669597116c01faa2c954de20a5102f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "participant.fullname" . }}-participant
        image: {{ .Values.participant.participant.image.repository }}:{{ .Values.participant.participant.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.participant.participant.imagePullPolicy }}
        name: participant
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.participant.participant.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.participant.participant.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "participant.fullname" . }}-participant
  labels:
  {{- include "participant.labels" . | nindent 4 }}
spec:
  type: {{ .Values.participant.type }}
  selector:
    app.kubernetes.io/instance: participant
    app.kubernetes.io/name: brown
  {{- include "participant.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.participant.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
participant:
  canopy: lasagna
  hybridisation: adrenaline
  lighting: mattock
  participant:
    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
  replicas: 1
  succotash: knee
  support: soybean
  type: ClusterIP
  vessel: delightful
