# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "eavesdropper.fullname" . }}-eavesdropper
  labels:
  {{- include "eavesdropper.labels" . | nindent 4 }}
data:
  DAIRY_STYLUS_INFIX: {{ .Values.eavesdropper.dairyStylusInfix | quote }}
  FLECK_ARK: {{ .Values.eavesdropper.fleckArk | quote }}
  KILLER_INTERNET: {{ .Values.eavesdropper.killerInternet | quote }}
  PROSE_ERRATIC: {{ .Values.eavesdropper.proseErratic | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "eavesdropper.fullname" . }}-eavesdropper
  labels:
  {{- include "eavesdropper.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: eavesdropper
spec:
  replicas: {{ .Values.eavesdropper.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: eavesdropper
      app.kubernetes.io/name: forte
    {{- include "eavesdropper.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: eavesdropper
        app.kubernetes.io/name: forte
      {{- include "eavesdropper.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a6f111264c7f092dbcd960a3f2481972545f7de8e6cfa889629f75b6c9f24e53
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "eavesdropper.fullname" . }}-eavesdropper
        image: {{ .Values.eavesdropper.eavesdropper.image.repository }}:{{ .Values.eavesdropper.eavesdropper.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.eavesdropper.eavesdropper.imagePullPolicy }}
        name: eavesdropper
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.eavesdropper.eavesdropper.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.eavesdropper.eavesdropper.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "eavesdropper.fullname" . }}-eavesdropper
  labels:
  {{- include "eavesdropper.labels" . | nindent 4 }}
spec:
  type: {{ .Values.eavesdropper.type }}
  selector:
    app.kubernetes.io/instance: eavesdropper
    app.kubernetes.io/name: forte
  {{- include "eavesdropper.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.eavesdropper.ports | toYaml | nindent 2 -}}
eavesdropper:
  dairyStylusInfix: convection
  eavesdropper:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fleckArk: moth
  killerInternet: timbale
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  proseErratic: soybean
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
