# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "speaking.fullname" . }}-speaking
  labels:
  {{- include "speaking.labels" . | nindent 4 }}
data:
  CLUTCH_NOTEPAD: {{ .Values.speaking.clutchNotepad | quote }}
  LAP: {{ .Values.speaking.lap | quote }}
  OBEISANT_FRICTION_STOP: {{ .Values.speaking.obeisantFrictionStop | quote }}
  REFLECTION: {{ .Values.speaking.reflection | quote }}
  STUFF_DEDUCTION: {{ .Values.speaking.stuffDeduction | quote }}
  VILLA: {{ .Values.speaking.villa | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "speaking.fullname" . }}-speaking
  labels:
  {{- include "speaking.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: speaking
spec:
  replicas: {{ .Values.speaking.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: speaking
      app.kubernetes.io/name: fedelini
    {{- include "speaking.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: speaking
        app.kubernetes.io/name: fedelini
      {{- include "speaking.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f3d7d041d0d5ca2f17d9d5c5dd218726b03d1d6ad168663fa361eace9052d0c0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "speaking.fullname" . }}-speaking
        image: {{ .Values.speaking.speaking.image.repository }}:{{ .Values.speaking.speaking.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.speaking.speaking.imagePullPolicy }}
        name: speaking
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.speaking.speaking.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.speaking.speaking.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "speaking.fullname" . }}-speaking
  labels:
  {{- include "speaking.labels" . | nindent 4 }}
spec:
  type: {{ .Values.speaking.type }}
  selector:
    app.kubernetes.io/instance: speaking
    app.kubernetes.io/name: fedelini
  {{- include "speaking.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.speaking.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
speaking:
  clutchNotepad: hermit
  lap: shallot
  obeisantFrictionStop: slider
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reflection: tonality
  replicas: 1
  speaking:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  stuffDeduction: magical
  type: ClusterIP
  villa: hotdog
