# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "lighting.fullname" . }}-lighting
  labels:
  {{- include "lighting.labels" . | nindent 4 }}
data:
  COIL: {{ .Values.lighting.coil | quote }}
  KNOW-HOW_SLOPPY: {{ .Values.lighting.knowHowSloppy | quote }}
  LABORATORY_THRIVE_JUMBO: {{ .Values.lighting.laboratoryThriveJumbo | quote }}
  MEMBER: {{ .Values.lighting.member | quote }}
  STRAND: {{ .Values.lighting.strand | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "lighting.fullname" . }}-lighting
  labels:
  {{- include "lighting.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: lighting
spec:
  replicas: {{ .Values.lighting.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: lighting
      app.kubernetes.io/name: printer
    {{- include "lighting.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: lighting
        app.kubernetes.io/name: printer
      {{- include "lighting.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d2725f6185f8c81e66fd08433963c57b15705508eaa4be646244f838042a04bc
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "lighting.fullname" . }}-lighting
        image: {{ .Values.lighting.lighting.image.repository }}:{{ .Values.lighting.lighting.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.lighting.lighting.imagePullPolicy }}
        name: lighting
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.lighting.lighting.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.lighting.lighting.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "lighting.fullname" . }}-lighting
  labels:
  {{- include "lighting.labels" . | nindent 4 }}
spec:
  type: {{ .Values.lighting.type }}
  selector:
    app.kubernetes.io/instance: lighting
    app.kubernetes.io/name: printer
  {{- include "lighting.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.lighting.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
lighting:
  coil: retention
  knowHowSloppy: top-hat
  laboratoryThriveJumbo: rivulet
  lighting:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  member: harvester
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  strand: spinach
  type: ClusterIP
