# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "nightlight.fullname" . }}-nightlight
  labels:
  {{- include "nightlight.labels" . | nindent 4 }}
data:
  ACADEMY_LEG_TREATMENT: {{ .Values.nightlight.academyLegTreatment | quote }}
  CHRONOGRAPH_CONSULATE_STANDARD: {{ .Values.nightlight.chronographConsulateStandard
    | quote }}
  GORILLA: {{ .Values.nightlight.gorilla | quote }}
  PLAYER_FETUS: {{ .Values.nightlight.playerFetus | quote }}
  QUART_POINT_BELLY: {{ .Values.nightlight.quartPointBelly | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "nightlight.fullname" . }}-nightlight
  labels:
  {{- include "nightlight.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: nightlight
spec:
  replicas: {{ .Values.nightlight.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: nightlight
      app.kubernetes.io/name: owe
    {{- include "nightlight.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: nightlight
        app.kubernetes.io/name: owe
      {{- include "nightlight.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 18d04d55caf6ba2b5662e66bd98fd2004fc62af6e38f3b870d49a21a945b5d4e
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "nightlight.fullname" . }}-nightlight
        image: {{ .Values.nightlight.nightlight.image.repository }}:{{ .Values.nightlight.nightlight.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.nightlight.nightlight.imagePullPolicy }}
        name: nightlight
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.nightlight.nightlight.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.nightlight.nightlight.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "nightlight.fullname" . }}-nightlight
  labels:
  {{- include "nightlight.labels" . | nindent 4 }}
spec:
  type: {{ .Values.nightlight.type }}
  selector:
    app.kubernetes.io/instance: nightlight
    app.kubernetes.io/name: owe
  {{- include "nightlight.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.nightlight.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
nightlight:
  academyLegTreatment: tenant
  chronographConsulateStandard: granny
  gorilla: conduct
  nightlight:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  playerFetus: stream
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quartPointBelly: toy
  replicas: 1
  type: ClusterIP
