# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "hutch.fullname" . }}-hutch
  labels:
  {{- include "hutch.labels" . | nindent 4 }}
data:
  DECISIVE_PANIC_CURD: {{ .Values.hutch.decisivePanicCurd | quote }}
  DUELING_PINSTRIPE: {{ .Values.hutch.duelingPinstripe | quote }}
  E-BOOK_COMMISSION: {{ .Values.hutch.eBookCommission | quote }}
  HOSPITALISATION_LIZARD: {{ .Values.hutch.hospitalisationLizard | quote }}
  SALMON_NOODLES: {{ .Values.hutch.salmonNoodles | quote }}
  SQUEEGEE_EDITION_DANGER: {{ .Values.hutch.squeegeeEditionDanger | quote }}
  TORPID: {{ .Values.hutch.torpid | quote }}
  WORD_DAMP: {{ .Values.hutch.wordDamp | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hutch.fullname" . }}-hutch
  labels:
  {{- include "hutch.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: hutch
spec:
  replicas: {{ .Values.hutch.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: hutch
      app.kubernetes.io/name: typical
    {{- include "hutch.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: hutch
        app.kubernetes.io/name: typical
      {{- include "hutch.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 87a67e0317850eddb8c70a0d16e293c42fb247e11ef5693bf3c04e64c6ef3438
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "hutch.fullname" . }}-hutch
        image: {{ .Values.hutch.hutch.image.repository }}:{{ .Values.hutch.hutch.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.hutch.hutch.imagePullPolicy }}
        name: hutch
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.hutch.hutch.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.hutch.hutch.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "hutch.fullname" . }}-hutch
  labels:
  {{- include "hutch.labels" . | nindent 4 }}
spec:
  type: {{ .Values.hutch.type }}
  selector:
    app.kubernetes.io/instance: hutch
    app.kubernetes.io/name: typical
  {{- include "hutch.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.hutch.ports | toYaml | nindent 2 -}}
hutch:
  decisivePanicCurd: methane
  duelingPinstripe: drawbridge
  eBookCommission: crayon
  hospitalisationLizard: congressman
  hutch:
    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
  replicas: 1
  salmonNoodles: gravitas
  squeegeeEditionDanger: bride
  torpid: doorbell
  type: ClusterIP
  wordDamp: discourse
kubernetesClusterDomain: cluster.local
