# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "noodle.fullname" . }}-noodle
  labels:
  {{- include "noodle.labels" . | nindent 4 }}
data:
  DISPLAY: {{ .Values.noodle.display | quote }}
  GAFFE: {{ .Values.noodle.gaffe | quote }}
  INCUBATION_POSTFIX: {{ .Values.noodle.incubationPostfix | quote }}
  INDICATOR: {{ .Values.noodle.indicator | quote }}
  MASSAGE: {{ .Values.noodle.massage | quote }}
  MENORAH_TABLECLOTH: {{ .Values.noodle.menorahTablecloth | quote }}
  PRIDE: {{ .Values.noodle.pride | quote }}
  TOP: {{ .Values.noodle.top | quote }}
  UTENSIL: {{ .Values.noodle.utensil | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "noodle.fullname" . }}-noodle
  labels:
  {{- include "noodle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: noodle
spec:
  replicas: {{ .Values.noodle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: noodle
      app.kubernetes.io/name: justify
    {{- include "noodle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: noodle
        app.kubernetes.io/name: justify
      {{- include "noodle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 54d04251abf314cfc76669076779732375693239533f55b881e6cf1b0fa45d30
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "noodle.fullname" . }}-noodle
        image: {{ .Values.noodle.noodle.image.repository }}:{{ .Values.noodle.noodle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.noodle.noodle.imagePullPolicy }}
        name: noodle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.noodle.noodle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.noodle.noodle.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "noodle.fullname" . }}-noodle
  labels:
  {{- include "noodle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.noodle.type }}
  selector:
    app.kubernetes.io/instance: noodle
    app.kubernetes.io/name: justify
  {{- include "noodle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.noodle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
noodle:
  display: watchful
  gaffe: age
  incubationPostfix: catch
  indicator: derby
  massage: billing
  menorahTablecloth: nectarine
  noodle:
    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
  pride: advise
  replicas: 1
  top: led
  type: ClusterIP
  utensil: take
