# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "chess.fullname" . }}-chess
  labels:
  {{- include "chess.labels" . | nindent 4 }}
data:
  BIRDBATH_JULIENNE_MOST: {{ .Values.chess.birdbathJulienneMost | quote }}
  CHASE_HERO_DIAGRAM: {{ .Values.chess.chaseHeroDiagram | quote }}
  MISSION: {{ .Values.chess.mission | quote }}
  MONKEY_OUTLAY_PENGUIN: {{ .Values.chess.monkeyOutlayPenguin | quote }}
  RAWHIDE_FOLLOW_BRINK: {{ .Values.chess.rawhideFollowBrink | quote }}
  WORTHLESS_DECADENCE_LAB: {{ .Values.chess.worthlessDecadenceLab | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "chess.fullname" . }}-chess
  labels:
  {{- include "chess.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: chess
spec:
  replicas: {{ .Values.chess.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: chess
      app.kubernetes.io/name: derivation
    {{- include "chess.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: chess
        app.kubernetes.io/name: derivation
      {{- include "chess.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e75fb1f71f6fc866b4506b1e6292d255819198b19aa9ac61bf436246f01bc5e4
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "chess.fullname" . }}-chess
        image: {{ .Values.chess.chess.image.repository }}:{{ .Values.chess.chess.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.chess.chess.imagePullPolicy }}
        name: chess
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.chess.chess.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.chess.chess.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "chess.fullname" . }}-chess
  labels:
  {{- include "chess.labels" . | nindent 4 }}
spec:
  type: {{ .Values.chess.type }}
  selector:
    app.kubernetes.io/instance: chess
    app.kubernetes.io/name: derivation
  {{- include "chess.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.chess.ports | toYaml | nindent 2 -}}
chess:
  birdbathJulienneMost: ingrate
  chaseHeroDiagram: tourist
  chess:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  mission: extreme
  monkeyOutlayPenguin: trailer
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rawhideFollowBrink: fetus
  replicas: 1
  type: ClusterIP
  worthlessDecadenceLab: print
kubernetesClusterDomain: cluster.local
