# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dashboard.fullname" . }}-dashboard
  labels:
  {{- include "dashboard.labels" . | nindent 4 }}
data:
  CONTROLLER: {{ .Values.dashboard.controller | quote }}
  EXPLANATION_LOGIN_PLATTER: {{ .Values.dashboard.explanationLoginPlatter | quote
    }}
  GOOD: {{ .Values.dashboard.good | quote }}
  SAILBOAT_LARVA_ARCHITECTURE: {{ .Values.dashboard.sailboatLarvaArchitecture | quote
    }}
  SULKY: {{ .Values.dashboard.sulky | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dashboard.fullname" . }}-dashboard
  labels:
  {{- include "dashboard.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dashboard
spec:
  replicas: {{ .Values.dashboard.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dashboard
      app.kubernetes.io/name: comfortable
    {{- include "dashboard.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dashboard
        app.kubernetes.io/name: comfortable
      {{- include "dashboard.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cb244725030cecc362d02d9d9e5d769e64e443434f456415fcb0104184d644b4
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dashboard.fullname" . }}-dashboard
        image: {{ .Values.dashboard.dashboard.image.repository }}:{{ .Values.dashboard.dashboard.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dashboard.dashboard.imagePullPolicy }}
        name: dashboard
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dashboard.dashboard.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dashboard.dashboard.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dashboard.fullname" . }}-dashboard
  labels:
  {{- include "dashboard.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dashboard.type }}
  selector:
    app.kubernetes.io/instance: dashboard
    app.kubernetes.io/name: comfortable
  {{- include "dashboard.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dashboard.ports | toYaml | nindent 2 -}}
dashboard:
  controller: didactic
  dashboard:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  explanationLoginPlatter: rainmaker
  good: muddle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sailboatLarvaArchitecture: runaway
  sulky: glamorous
  type: ClusterIP
kubernetesClusterDomain: cluster.local
