# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mister.fullname" . }}-mister
  labels:
  {{- include "mister.labels" . | nindent 4 }}
data:
  COMPUTE_TRANSFORMATION: {{ .Values.mister.computeTransformation | quote }}
  DECORATION: {{ .Values.mister.decoration | quote }}
  SUBURB_SMOGGY_ASCOT: {{ .Values.mister.suburbSmoggyAscot | quote }}
  TECHNOLOGIST_TRAMP: {{ .Values.mister.technologistTramp | quote }}
  TERRORISM_DISAGREEABLE_FATHER: {{ .Values.mister.terrorismDisagreeableFather |
    quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "mister.fullname" . }}-mister
  labels:
  {{- include "mister.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: mister
spec:
  replicas: {{ .Values.mister.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: mister
      app.kubernetes.io/name: tick
    {{- include "mister.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: mister
        app.kubernetes.io/name: tick
      {{- include "mister.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ce051dc5ae37f551fa2e3331fe9a9db72eaddd035ab6da003f962a8540c00f6a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "mister.fullname" . }}-mister
        image: {{ .Values.mister.mister.image.repository }}:{{ .Values.mister.mister.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.mister.mister.imagePullPolicy }}
        name: mister
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.mister.mister.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.mister.mister.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "mister.fullname" . }}-mister
  labels:
  {{- include "mister.labels" . | nindent 4 }}
spec:
  type: {{ .Values.mister.type }}
  selector:
    app.kubernetes.io/instance: mister
    app.kubernetes.io/name: tick
  {{- include "mister.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.mister.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
mister:
  computeTransformation: textual
  decoration: alpha
  mister:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  suburbSmoggyAscot: ceiling
  technologistTramp: reward
  terrorismDisagreeableFather: spud
  type: ClusterIP
