# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tambourine.fullname" . }}-tambourine
  labels:
  {{- include "tambourine.labels" . | nindent 4 }}
data:
  LIMITATION: {{ .Values.tambourine.limitation | quote }}
  PLEAT: {{ .Values.tambourine.pleat | quote }}
  WRENCH: {{ .Values.tambourine.wrench | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tambourine.fullname" . }}-tambourine
  labels:
  {{- include "tambourine.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tambourine
spec:
  replicas: {{ .Values.tambourine.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tambourine
      app.kubernetes.io/name: macabre
    {{- include "tambourine.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tambourine
        app.kubernetes.io/name: macabre
      {{- include "tambourine.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e5bbbc3292d5d4e22fb517896275130bd7b92abc8c8add7edb2e9e9880e0f7c8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tambourine.fullname" . }}-tambourine
        image: {{ .Values.tambourine.tambourine.image.repository }}:{{ .Values.tambourine.tambourine.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tambourine.tambourine.imagePullPolicy }}
        name: tambourine
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tambourine.tambourine.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tambourine.tambourine.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tambourine.fullname" . }}-tambourine
  labels:
  {{- include "tambourine.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tambourine.type }}
  selector:
    app.kubernetes.io/instance: tambourine
    app.kubernetes.io/name: macabre
  {{- include "tambourine.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tambourine.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tambourine:
  limitation: fashion
  pleat: lackadaisical
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tambourine:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  wrench: cough
