# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "temper.fullname" . }}-temper
  labels:
  {{- include "temper.labels" . | nindent 4 }}
data:
  EXERCISE: {{ .Values.temper.exercise | quote }}
  LLAMA: {{ .Values.temper.llama | quote }}
  PANIC: {{ .Values.temper.panic | quote }}
  RAINMAKER_RIOT: {{ .Values.temper.rainmakerRiot | quote }}
  RUB: {{ .Values.temper.rub | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "temper.fullname" . }}-temper
  labels:
  {{- include "temper.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: temper
spec:
  replicas: {{ .Values.temper.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: temper
      app.kubernetes.io/name: muscle
    {{- include "temper.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: temper
        app.kubernetes.io/name: muscle
      {{- include "temper.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1fa8bcb36d6b03554720a044e881f14aa05fff1e90e32ea46195a19d8cb535f8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "temper.fullname" . }}-temper
        image: {{ .Values.temper.temper.image.repository }}:{{ .Values.temper.temper.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.temper.temper.imagePullPolicy }}
        name: temper
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.temper.temper.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.temper.temper.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "temper.fullname" . }}-temper
  labels:
  {{- include "temper.labels" . | nindent 4 }}
spec:
  type: {{ .Values.temper.type }}
  selector:
    app.kubernetes.io/instance: temper
    app.kubernetes.io/name: muscle
  {{- include "temper.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.temper.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
temper:
  exercise: matter
  llama: min
  panic: forelimb
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rainmakerRiot: distance
  replicas: 1
  rub: pride
  temper:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
