# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "board.fullname" . }}-board
  labels:
  {{- include "board.labels" . | nindent 4 }}
data:
  CRAFTSMAN: {{ .Values.board.craftsman | quote }}
  EFFECTIVE_FARMLAND: {{ .Values.board.effectiveFarmland | quote }}
  INFIX: {{ .Values.board.infix | quote }}
  OBSERVATORY_HALIBUT: {{ .Values.board.observatoryHalibut | quote }}
  PHYSICS: {{ .Values.board.physics | quote }}
  UNDERCLOTHES_NECKTIE_SPACE: {{ .Values.board.underclothesNecktieSpace | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "board.fullname" . }}-board
  labels:
  {{- include "board.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: board
spec:
  replicas: {{ .Values.board.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: board
      app.kubernetes.io/name: tuba
    {{- include "board.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: board
        app.kubernetes.io/name: tuba
      {{- include "board.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d4021a04036758d44c7f47ba214159ebe4af22c31d1e244fdc76f7ca1f70eed0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "board.fullname" . }}-board
        image: {{ .Values.board.board.image.repository }}:{{ .Values.board.board.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.board.board.imagePullPolicy }}
        name: board
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.board.board.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.board.board.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "board.fullname" . }}-board
  labels:
  {{- include "board.labels" . | nindent 4 }}
spec:
  type: {{ .Values.board.type }}
  selector:
    app.kubernetes.io/instance: board
    app.kubernetes.io/name: tuba
  {{- include "board.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.board.ports | toYaml | nindent 2 -}}
board:
  board:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  craftsman: elver
  effectiveFarmland: abrupt
  infix: revolver
  observatoryHalibut: conga
  physics: tiny
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  underclothesNecktieSpace: mercury
kubernetesClusterDomain: cluster.local
