# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "thyme.fullname" . }}-thyme
  labels:
  {{- include "thyme.labels" . | nindent 4 }}
data:
  ELDERLY_PLACEMENT_DANGER: {{ .Values.thyme.elderlyPlacementDanger | quote }}
  GALLEY: {{ .Values.thyme.galley | quote }}
  HUNGER_FUGATO: {{ .Values.thyme.hungerFugato | quote }}
  MOUTON_ABSTRACTED_SAVINGS: {{ .Values.thyme.moutonAbstractedSavings | quote }}
  WELFARE: {{ .Values.thyme.welfare | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "thyme.fullname" . }}-thyme
  labels:
  {{- include "thyme.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: thyme
spec:
  replicas: {{ .Values.thyme.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: thyme
      app.kubernetes.io/name: urn
    {{- include "thyme.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: thyme
        app.kubernetes.io/name: urn
      {{- include "thyme.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: da962f4be44a96f597549ec1821f42d5ef809ab3a21cf73a433a969bcf30a5fc
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "thyme.fullname" . }}-thyme
        image: {{ .Values.thyme.thyme.image.repository }}:{{ .Values.thyme.thyme.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.thyme.thyme.imagePullPolicy }}
        name: thyme
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.thyme.thyme.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.thyme.thyme.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "thyme.fullname" . }}-thyme
  labels:
  {{- include "thyme.labels" . | nindent 4 }}
spec:
  type: {{ .Values.thyme.type }}
  selector:
    app.kubernetes.io/instance: thyme
    app.kubernetes.io/name: urn
  {{- include "thyme.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.thyme.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
thyme:
  elderlyPlacementDanger: chinchilla
  galley: account
  hungerFugato: elevator
  moutonAbstractedSavings: bongo
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  thyme:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  welfare: direct
