# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "blind.fullname" . }}-blind
  labels:
  {{- include "blind.labels" . | nindent 4 }}
data:
  FRONTIER_LOOSE: {{ .Values.blind.frontierLoose | quote }}
  FURRY_UTTER_INSPECT: {{ .Values.blind.furryUtterInspect | quote }}
  INSOLENCE_GUITARIST: {{ .Values.blind.insolenceGuitarist | quote }}
  JOB: {{ .Values.blind.job | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "blind.fullname" . }}-blind
  labels:
  {{- include "blind.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: blind
spec:
  replicas: {{ .Values.blind.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: blind
      app.kubernetes.io/name: selling
    {{- include "blind.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: blind
        app.kubernetes.io/name: selling
      {{- include "blind.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a76f516ce151d11c8d7b350c25a196417fccca3f9f0778b31cfb14d6429cd6dc
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "blind.fullname" . }}-blind
        image: {{ .Values.blind.blind.image.repository }}:{{ .Values.blind.blind.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.blind.blind.imagePullPolicy }}
        name: blind
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.blind.blind.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.blind.blind.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "blind.fullname" . }}-blind
  labels:
  {{- include "blind.labels" . | nindent 4 }}
spec:
  type: {{ .Values.blind.type }}
  selector:
    app.kubernetes.io/instance: blind
    app.kubernetes.io/name: selling
  {{- include "blind.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.blind.ports | toYaml | nindent 2 -}}
blind:
  blind:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  frontierLoose: headline
  furryUtterInspect: plasterboard
  insolenceGuitarist: grandmom
  job: domineering
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
