# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "timber.fullname" . }}-timber
  labels:
  {{- include "timber.labels" . | nindent 4 }}
data:
  BANNER_ORIGINAL_DEPOT: {{ .Values.timber.bannerOriginalDepot | quote }}
  LASAGNA_DISGUST: {{ .Values.timber.lasagnaDisgust | quote }}
  POST_LICENSING: {{ .Values.timber.postLicensing | quote }}
  SAVIOUR_GAMEBIRD: {{ .Values.timber.saviourGamebird | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "timber.fullname" . }}-timber
  labels:
  {{- include "timber.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: timber
spec:
  replicas: {{ .Values.timber.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: timber
      app.kubernetes.io/name: animated
    {{- include "timber.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: timber
        app.kubernetes.io/name: animated
      {{- include "timber.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 06cba50fa80fd138d1144666c2899f4175fd85d3b2375d11ba6a8d6d43f484ab
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "timber.fullname" . }}-timber
        image: {{ .Values.timber.timber.image.repository }}:{{ .Values.timber.timber.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.timber.timber.imagePullPolicy }}
        name: timber
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.timber.timber.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.timber.timber.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "timber.fullname" . }}-timber
  labels:
  {{- include "timber.labels" . | nindent 4 }}
spec:
  type: {{ .Values.timber.type }}
  selector:
    app.kubernetes.io/instance: timber
    app.kubernetes.io/name: animated
  {{- include "timber.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.timber.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
timber:
  bannerOriginalDepot: grandchild
  lasagnaDisgust: smiling
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  postLicensing: examiner
  replicas: 1
  saviourGamebird: freak
  timber:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
