# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tattler.fullname" . }}-tattler
  labels:
  {{- include "tattler.labels" . | nindent 4 }}
data:
  APPEAR: {{ .Values.tattler.appear | quote }}
  BABUSHKA_HORSE: {{ .Values.tattler.babushkaHorse | quote }}
  BIRDBATH: {{ .Values.tattler.birdbath | quote }}
  BREATH: {{ .Values.tattler.breath | quote }}
  CONFIRMATION: {{ .Values.tattler.confirmation | quote }}
  FREEZING_DECLINATION: {{ .Values.tattler.freezingDeclination | quote }}
  GLEE_RAT_SHOESTRING: {{ .Values.tattler.gleeRatShoestring | quote }}
  WAKE: {{ .Values.tattler.wake | quote }}
  WEBPAGE_BUZZARD_LOVING: {{ .Values.tattler.webpageBuzzardLoving | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tattler.fullname" . }}-tattler
  labels:
  {{- include "tattler.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tattler
spec:
  replicas: {{ .Values.tattler.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tattler
      app.kubernetes.io/name: snorer
    {{- include "tattler.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tattler
        app.kubernetes.io/name: snorer
      {{- include "tattler.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ca5ce4437b706c99154c2eaeb7fa6273c4bc61e2f1c196f9d1c9eb7b19d4e669
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tattler.fullname" . }}-tattler
        image: {{ .Values.tattler.tattler.image.repository }}:{{ .Values.tattler.tattler.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tattler.tattler.imagePullPolicy }}
        name: tattler
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tattler.tattler.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tattler.tattler.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tattler.fullname" . }}-tattler
  labels:
  {{- include "tattler.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tattler.type }}
  selector:
    app.kubernetes.io/instance: tattler
    app.kubernetes.io/name: snorer
  {{- include "tattler.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tattler.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tattler:
  appear: shearling
  babushkaHorse: hovercraft
  birdbath: nerve
  breath: appetite
  confirmation: recipe
  freezingDeclination: painter
  gleeRatShoestring: vaccine
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tattler:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  wake: cohesion
  webpageBuzzardLoving: treasure
