# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "nappy.fullname" . }}-nappy
  labels:
  {{- include "nappy.labels" . | nindent 4 }}
data:
  ISSUE: {{ .Values.nappy.issue | quote }}
  LOT: {{ .Values.nappy.lot | quote }}
  NAVIGATION: {{ .Values.nappy.navigation | quote }}
  PRETZEL_CREWMEMBER_DIGGER: {{ .Values.nappy.pretzelCrewmemberDigger | quote }}
  SPARKLE_TACKY: {{ .Values.nappy.sparkleTacky | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "nappy.fullname" . }}-nappy
  labels:
  {{- include "nappy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: nappy
spec:
  replicas: {{ .Values.nappy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: nappy
      app.kubernetes.io/name: meridian
    {{- include "nappy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: nappy
        app.kubernetes.io/name: meridian
      {{- include "nappy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b5505ce4af2d5707cc9a5215bb1c57bd245157791d72cb092ba4443a8ad7e975
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "nappy.fullname" . }}-nappy
        image: {{ .Values.nappy.nappy.image.repository }}:{{ .Values.nappy.nappy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.nappy.nappy.imagePullPolicy }}
        name: nappy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.nappy.nappy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.nappy.nappy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "nappy.fullname" . }}-nappy
  labels:
  {{- include "nappy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.nappy.type }}
  selector:
    app.kubernetes.io/instance: nappy
    app.kubernetes.io/name: meridian
  {{- include "nappy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.nappy.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
nappy:
  issue: painter
  lot: spreadsheet
  nappy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  navigation: difficulty
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pretzelCrewmemberDigger: stinger
  replicas: 1
  sparkleTacky: bafflement
  type: ClusterIP
