# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "entry.fullname" . }}-entry
  labels:
  {{- include "entry.labels" . | nindent 4 }}
data:
  EDITED_SITE: {{ .Values.entry.editedSite | quote }}
  EXTERNAL: {{ .Values.entry.external | quote }}
  REDUCE_STINK: {{ .Values.entry.reduceStink | quote }}
  RELIABILITY_ARTHUR_CANVAS: {{ .Values.entry.reliabilityArthurCanvas | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "entry.fullname" . }}-entry
  labels:
  {{- include "entry.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: entry
spec:
  replicas: {{ .Values.entry.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: entry
      app.kubernetes.io/name: haunt
    {{- include "entry.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: entry
        app.kubernetes.io/name: haunt
      {{- include "entry.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 70e7d7d90422d440d568ce3e324703fc5b89e8a1f7834ccd7339937068170b55
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "entry.fullname" . }}-entry
        image: {{ .Values.entry.entry.image.repository }}:{{ .Values.entry.entry.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.entry.entry.imagePullPolicy }}
        name: entry
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.entry.entry.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.entry.entry.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "entry.fullname" . }}-entry
  labels:
  {{- include "entry.labels" . | nindent 4 }}
spec:
  type: {{ .Values.entry.type }}
  selector:
    app.kubernetes.io/instance: entry
    app.kubernetes.io/name: haunt
  {{- include "entry.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.entry.ports | toYaml | nindent 2 -}}
entry:
  editedSite: marker
  entry:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  external: clone
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reduceStink: yoyo
  reliabilityArthurCanvas: crime
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
