# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "catalog.fullname" . }}-catalog
  labels:
  {{- include "catalog.labels" . | nindent 4 }}
data:
  CHEAT_INCH_HOTDOG: {{ .Values.catalog.cheatInchHotdog | quote }}
  CONTRIBUTION: {{ .Values.catalog.contribution | quote }}
  FORGET: {{ .Values.catalog.forget | quote }}
  GROVE: {{ .Values.catalog.grove | quote }}
  GRUMPY_EXPERTISE: {{ .Values.catalog.grumpyExpertise | quote }}
  LOCK_LIEU: {{ .Values.catalog.lockLieu | quote }}
  LYMPHOCYTE_HYDROLYSE_INTERCHANGE: {{ .Values.catalog.lymphocyteHydrolyseInterchange
    | quote }}
  MACRAME: {{ .Values.catalog.macrame | quote }}
  OPENING: {{ .Values.catalog.opening | quote }}
  TERMINOLOGY_WEAKNESS: {{ .Values.catalog.terminologyWeakness | quote }}
  UGLY_WOODEN_POUNDING: {{ .Values.catalog.uglyWoodenPounding | quote }}
  ZEBRA_TAM-O-SHANTER: {{ .Values.catalog.zebraTamOShanter | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "catalog.fullname" . }}-catalog
  labels:
  {{- include "catalog.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: catalog
spec:
  replicas: {{ .Values.catalog.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: catalog
      app.kubernetes.io/name: horst
    {{- include "catalog.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: catalog
        app.kubernetes.io/name: horst
      {{- include "catalog.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e374007c667b57d8f0072f23a9f2d7823071163ca650b57367383ee69d07333f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "catalog.fullname" . }}-catalog
        image: {{ .Values.catalog.catalog.image.repository }}:{{ .Values.catalog.catalog.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.catalog.catalog.imagePullPolicy }}
        name: catalog
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.catalog.catalog.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.catalog.catalog.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "catalog.fullname" . }}-catalog
  labels:
  {{- include "catalog.labels" . | nindent 4 }}
spec:
  type: {{ .Values.catalog.type }}
  selector:
    app.kubernetes.io/instance: catalog
    app.kubernetes.io/name: horst
  {{- include "catalog.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.catalog.ports | toYaml | nindent 2 -}}
catalog:
  catalog:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  cheatInchHotdog: sermon
  contribution: prohibition
  forget: ascot
  grove: turmeric
  grumpyExpertise: consulate
  lockLieu: embryo
  lymphocyteHydrolyseInterchange: salt
  macrame: spot
  opening: crumb
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  terminologyWeakness: handover
  type: ClusterIP
  uglyWoodenPounding: mop
  zebraTamOShanter: foreigner
kubernetesClusterDomain: cluster.local
