# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "drawing.fullname" . }}-drawing
  labels:
  {{- include "drawing.labels" . | nindent 4 }}
data:
  ALIAS_MARKETING: {{ .Values.drawing.aliasMarketing | quote }}
  FINER_STONEWORK: {{ .Values.drawing.finerStonework | quote }}
  SUCK_OVERLOAD_WARM: {{ .Values.drawing.suckOverloadWarm | quote }}
  VELDT: {{ .Values.drawing.veldt | quote }}
  WILL_OPTIMISATION: {{ .Values.drawing.willOptimisation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "drawing.fullname" . }}-drawing
  labels:
  {{- include "drawing.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: drawing
spec:
  replicas: {{ .Values.drawing.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: drawing
      app.kubernetes.io/name: scarecrow
    {{- include "drawing.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: drawing
        app.kubernetes.io/name: scarecrow
      {{- include "drawing.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a33ea99ede9d5d515d0afc1dcdb7be04afd8dce3fb457c4e74ca48ee932192f0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "drawing.fullname" . }}-drawing
        image: {{ .Values.drawing.drawing.image.repository }}:{{ .Values.drawing.drawing.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.drawing.drawing.imagePullPolicy }}
        name: drawing
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.drawing.drawing.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.drawing.drawing.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "drawing.fullname" . }}-drawing
  labels:
  {{- include "drawing.labels" . | nindent 4 }}
spec:
  type: {{ .Values.drawing.type }}
  selector:
    app.kubernetes.io/instance: drawing
    app.kubernetes.io/name: scarecrow
  {{- include "drawing.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.drawing.ports | toYaml | nindent 2 -}}
drawing:
  aliasMarketing: gamma-ray
  drawing:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  finerStonework: wooden
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  suckOverloadWarm: myth
  type: ClusterIP
  veldt: today
  willOptimisation: nasal
kubernetesClusterDomain: cluster.local
