# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "waterspout.fullname" . }}-waterspout
  labels:
  {{- include "waterspout.labels" . | nindent 4 }}
data:
  EXPERT_APPLAUSE: {{ .Values.waterspout.expertApplause | quote }}
  FORM: {{ .Values.waterspout.form | quote }}
  FROCK_STITCHER: {{ .Values.waterspout.frockStitcher | quote }}
  HASSOCK_DOUBLE_FRICTION: {{ .Values.waterspout.hassockDoubleFriction | quote }}
  ITCHY_TAMBOUR_INNOCENT: {{ .Values.waterspout.itchyTambourInnocent | quote }}
  PHILOSOPHER_JAR_WISDOM: {{ .Values.waterspout.philosopherJarWisdom | quote }}
  REHOSPITALISATION_SPURIOUS: {{ .Values.waterspout.rehospitalisationSpurious | quote
    }}
  VALIDATE: {{ .Values.waterspout.validate | quote }}
  VISTA_MACHINERY: {{ .Values.waterspout.vistaMachinery | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "waterspout.fullname" . }}-waterspout
  labels:
  {{- include "waterspout.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: waterspout
spec:
  replicas: {{ .Values.waterspout.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: waterspout
      app.kubernetes.io/name: plaster
    {{- include "waterspout.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: waterspout
        app.kubernetes.io/name: plaster
      {{- include "waterspout.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 36a56e9f093cb641101f30a8e7f92a1768a330435956c82d0fa0244b564eed7c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "waterspout.fullname" . }}-waterspout
        image: {{ .Values.waterspout.waterspout.image.repository }}:{{ .Values.waterspout.waterspout.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.waterspout.waterspout.imagePullPolicy }}
        name: waterspout
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.waterspout.waterspout.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.waterspout.waterspout.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "waterspout.fullname" . }}-waterspout
  labels:
  {{- include "waterspout.labels" . | nindent 4 }}
spec:
  type: {{ .Values.waterspout.type }}
  selector:
    app.kubernetes.io/instance: waterspout
    app.kubernetes.io/name: plaster
  {{- include "waterspout.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.waterspout.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
waterspout:
  expertApplause: grill
  form: peony
  frockStitcher: counsellor
  hassockDoubleFriction: bitten
  itchyTambourInnocent: notoriety
  philosopherJarWisdom: muscatel
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rehospitalisationSpurious: basin
  replicas: 1
  type: ClusterIP
  validate: shaw
  vistaMachinery: sexuality
  waterspout:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
