# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "entree.fullname" . }}-entree
  labels:
  {{- include "entree.labels" . | nindent 4 }}
data:
  CORN: {{ .Values.entree.corn | quote }}
  DECADE_DIAPER: {{ .Values.entree.decadeDiaper | quote }}
  MUFFIN: {{ .Values.entree.muffin | quote }}
  SYNTHESIS_SNUGGLE_MESSENGER: {{ .Values.entree.synthesisSnuggleMessenger | quote
    }}
  ULTRA: {{ .Values.entree.ultra | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "entree.fullname" . }}-entree
  labels:
  {{- include "entree.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: entree
spec:
  replicas: {{ .Values.entree.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: entree
      app.kubernetes.io/name: error
    {{- include "entree.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: entree
        app.kubernetes.io/name: error
      {{- include "entree.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 25f1a13ec9cdf462af85bd8c4a57319a9ff18f55ea2e56e6364918bcf61fb716
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "entree.fullname" . }}-entree
        image: {{ .Values.entree.entree.image.repository }}:{{ .Values.entree.entree.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.entree.entree.imagePullPolicy }}
        name: entree
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.entree.entree.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.entree.entree.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "entree.fullname" . }}-entree
  labels:
  {{- include "entree.labels" . | nindent 4 }}
spec:
  type: {{ .Values.entree.type }}
  selector:
    app.kubernetes.io/instance: entree
    app.kubernetes.io/name: error
  {{- include "entree.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.entree.ports | toYaml | nindent 2 -}}
entree:
  corn: disgust
  decadeDiaper: exposure
  entree:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  muffin: car
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  synthesisSnuggleMessenger: toenail
  type: ClusterIP
  ultra: layout
kubernetesClusterDomain: cluster.local
