# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "sketch.fullname" . }}-sketch
  labels:
  {{- include "sketch.labels" . | nindent 4 }}
data:
  AIRPLANE_MELON_TEEN: {{ .Values.sketch.airplaneMelonTeen | quote }}
  BRIGHT_HIGHFALUTIN_TENSE: {{ .Values.sketch.brightHighfalutinTense | quote }}
  DIRNDL_ADOPTION_FLUTTERING: {{ .Values.sketch.dirndlAdoptionFluttering | quote
    }}
  DIVERSITY_EXPAND_SUFFOCATION: {{ .Values.sketch.diversityExpandSuffocation | quote
    }}
  ECHIDNA_CANOPY_EXPERIENCE: {{ .Values.sketch.echidnaCanopyExperience | quote }}
  REVOLVER: {{ .Values.sketch.revolver | quote }}
  RUFFLE_BUDDY: {{ .Values.sketch.ruffleBuddy | quote }}
  SLAP: {{ .Values.sketch.slap | quote }}
  YAWL_STRAND_NORMALISATION: {{ .Values.sketch.yawlStrandNormalisation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "sketch.fullname" . }}-sketch
  labels:
  {{- include "sketch.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: sketch
spec:
  replicas: {{ .Values.sketch.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: sketch
      app.kubernetes.io/name: judge
    {{- include "sketch.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: sketch
        app.kubernetes.io/name: judge
      {{- include "sketch.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0b68e43ee3b2b6ae74f8b84b788b34dafc6d434a6c4ac1e0e001e3be5074fa10
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "sketch.fullname" . }}-sketch
        image: {{ .Values.sketch.sketch.image.repository }}:{{ .Values.sketch.sketch.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.sketch.sketch.imagePullPolicy }}
        name: sketch
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.sketch.sketch.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.sketch.sketch.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "sketch.fullname" . }}-sketch
  labels:
  {{- include "sketch.labels" . | nindent 4 }}
spec:
  type: {{ .Values.sketch.type }}
  selector:
    app.kubernetes.io/instance: sketch
    app.kubernetes.io/name: judge
  {{- include "sketch.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.sketch.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
sketch:
  airplaneMelonTeen: trove
  brightHighfalutinTense: dessert
  dirndlAdoptionFluttering: pseudoscience
  diversityExpandSuffocation: sash
  echidnaCanopyExperience: doubt
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  revolver: lake
  ruffleBuddy: belfry
  sketch:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  slap: topic
  type: ClusterIP
  yawlStrandNormalisation: bijou
