# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "talk.fullname" . }}-talk
  labels:
  {{- include "talk.labels" . | nindent 4 }}
data:
  DESTROY: {{ .Values.talk.destroy | quote }}
  HARDHAT: {{ .Values.talk.hardhat | quote }}
  PROVINCE_EXPENSE_CLOCKWORK: {{ .Values.talk.provinceExpenseClockwork | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "talk.fullname" . }}-talk
  labels:
  {{- include "talk.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: talk
spec:
  replicas: {{ .Values.talk.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: talk
      app.kubernetes.io/name: bonsai
    {{- include "talk.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: talk
        app.kubernetes.io/name: bonsai
      {{- include "talk.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b6c75788f554fbc1e8300a8a0b4a39bcbafc8ddfc718e48cceac5ecc7d6e43ef
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "talk.fullname" . }}-talk
        image: {{ .Values.talk.talk.image.repository }}:{{ .Values.talk.talk.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.talk.talk.imagePullPolicy }}
        name: talk
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.talk.talk.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.talk.talk.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "talk.fullname" . }}-talk
  labels:
  {{- include "talk.labels" . | nindent 4 }}
spec:
  type: {{ .Values.talk.type }}
  selector:
    app.kubernetes.io/instance: talk
    app.kubernetes.io/name: bonsai
  {{- include "talk.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.talk.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
talk:
  destroy: amusement
  hardhat: blowhole
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  provinceExpenseClockwork: formamide
  replicas: 1
  talk:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
