# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "observant.fullname" . }}-observant
  labels:
  {{- include "observant.labels" . | nindent 4 }}
data:
  ANTICODON: {{ .Values.observant.anticodon | quote }}
  FEED: {{ .Values.observant.feed | quote }}
  GUARDED: {{ .Values.observant.guarded | quote }}
  INCANDESCENCE: {{ .Values.observant.incandescence | quote }}
  KENNEL_MARKED: {{ .Values.observant.kennelMarked | quote }}
  RALLY_HAMBURGER_CLOUD: {{ .Values.observant.rallyHamburgerCloud | quote }}
  SOAK_SKUNK: {{ .Values.observant.soakSkunk | quote }}
  SOMERSAULT_TURTLE_SECURITY: {{ .Values.observant.somersaultTurtleSecurity | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "observant.fullname" . }}-observant
  labels:
  {{- include "observant.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: observant
spec:
  replicas: {{ .Values.observant.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: observant
      app.kubernetes.io/name: chem
    {{- include "observant.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: observant
        app.kubernetes.io/name: chem
      {{- include "observant.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f21e152c4ca27a0654774641d048146ab5aa2cf0b9182c7ae9ddea68b3e5d395
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "observant.fullname" . }}-observant
        image: {{ .Values.observant.observant.image.repository }}:{{ .Values.observant.observant.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.observant.observant.imagePullPolicy }}
        name: observant
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.observant.observant.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.observant.observant.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "observant.fullname" . }}-observant
  labels:
  {{- include "observant.labels" . | nindent 4 }}
spec:
  type: {{ .Values.observant.type }}
  selector:
    app.kubernetes.io/instance: observant
    app.kubernetes.io/name: chem
  {{- include "observant.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.observant.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
observant:
  anticodon: consistency
  feed: greens
  guarded: observe
  incandescence: candelabra
  kennelMarked: ark
  observant:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rallyHamburgerCloud: emergency
  replicas: 1
  soakSkunk: donation
  somersaultTurtleSecurity: habitual
  type: ClusterIP
