# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "scow.fullname" . }}-scow
  labels:
  {{- include "scow.labels" . | nindent 4 }}
data:
  COUPON: {{ .Values.scow.coupon | quote }}
  MAPLE_TRANSCRIPT_FOOT: {{ .Values.scow.mapleTranscriptFoot | quote }}
  MULE_TRIGONOMETRY: {{ .Values.scow.muleTrigonometry | quote }}
  RATTY: {{ .Values.scow.ratty | quote }}
  SAVIOR_CANVAS_HICCUPS: {{ .Values.scow.saviorCanvasHiccups | quote }}
  TOPIC_VIBRISSAE: {{ .Values.scow.topicVibrissae | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "scow.fullname" . }}-scow
  labels:
  {{- include "scow.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: scow
spec:
  replicas: {{ .Values.scow.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: scow
      app.kubernetes.io/name: hospitalization
    {{- include "scow.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: scow
        app.kubernetes.io/name: hospitalization
      {{- include "scow.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b440f8067a4e2235b00cc15658dec9c6219257e26c852f680b2f77b1796d0080
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "scow.fullname" . }}-scow
        image: {{ .Values.scow.scow.image.repository }}:{{ .Values.scow.scow.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.scow.scow.imagePullPolicy }}
        name: scow
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.scow.scow.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.scow.scow.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "scow.fullname" . }}-scow
  labels:
  {{- include "scow.labels" . | nindent 4 }}
spec:
  type: {{ .Values.scow.type }}
  selector:
    app.kubernetes.io/instance: scow
    app.kubernetes.io/name: hospitalization
  {{- include "scow.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.scow.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
scow:
  coupon: smelly
  mapleTranscriptFoot: dinner
  muleTrigonometry: xylophone
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  ratty: orchid
  replicas: 1
  saviorCanvasHiccups: prohibition
  scow:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  topicVibrissae: calculator
  type: ClusterIP
