# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "monsoon.fullname" . }}-monsoon
  labels:
  {{- include "monsoon.labels" . | nindent 4 }}
data:
  LIABILITY_BLOOM_CONTEST: {{ .Values.monsoon.liabilityBloomContest | quote }}
  MONTH_BADGE_DECORATE: {{ .Values.monsoon.monthBadgeDecorate | quote }}
  SCORE_LIZARD: {{ .Values.monsoon.scoreLizard | quote }}
  TENDENCY: {{ .Values.monsoon.tendency | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "monsoon.fullname" . }}-monsoon
  labels:
  {{- include "monsoon.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: monsoon
spec:
  replicas: {{ .Values.monsoon.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: monsoon
      app.kubernetes.io/name: apparatus
    {{- include "monsoon.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: monsoon
        app.kubernetes.io/name: apparatus
      {{- include "monsoon.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5eb182860c802b9ff992020127796051633ce45d8df73e5b12cafa061b1f063a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "monsoon.fullname" . }}-monsoon
        image: {{ .Values.monsoon.monsoon.image.repository }}:{{ .Values.monsoon.monsoon.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.monsoon.monsoon.imagePullPolicy }}
        name: monsoon
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.monsoon.monsoon.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.monsoon.monsoon.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "monsoon.fullname" . }}-monsoon
  labels:
  {{- include "monsoon.labels" . | nindent 4 }}
spec:
  type: {{ .Values.monsoon.type }}
  selector:
    app.kubernetes.io/instance: monsoon
    app.kubernetes.io/name: apparatus
  {{- include "monsoon.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.monsoon.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
monsoon:
  liabilityBloomContest: hill
  monsoon:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  monthBadgeDecorate: teepee
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scoreLizard: tattler
  tendency: intentionality
  type: ClusterIP
