# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tomato.fullname" . }}-tomato
  labels:
  {{- include "tomato.labels" . | nindent 4 }}
data:
  CONSIDERATION: {{ .Values.tomato.consideration | quote }}
  DECONGESTANT_ONLINE: {{ .Values.tomato.decongestantOnline | quote }}
  DIMPLE_VISUAL: {{ .Values.tomato.dimpleVisual | quote }}
  FASHION_AIRSPACE: {{ .Values.tomato.fashionAirspace | quote }}
  FERTILIZER_BATTLESHIP_CHIMPANZEE: {{ .Values.tomato.fertilizerBattleshipChimpanzee
    | quote }}
  HERMIT_LAUNCH: {{ .Values.tomato.hermitLaunch | quote }}
  LEAVER_LOCKER: {{ .Values.tomato.leaverLocker | quote }}
  MOAN: {{ .Values.tomato.moan | quote }}
  OCCURRENCE: {{ .Values.tomato.occurrence | quote }}
  RECOMMEND_RELATIONSHIP_HEART: {{ .Values.tomato.recommendRelationshipHeart | quote
    }}
  SUPERVISOR_ADVOCATE: {{ .Values.tomato.supervisorAdvocate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tomato.fullname" . }}-tomato
  labels:
  {{- include "tomato.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tomato
spec:
  replicas: {{ .Values.tomato.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tomato
      app.kubernetes.io/name: herring
    {{- include "tomato.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tomato
        app.kubernetes.io/name: herring
      {{- include "tomato.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 81bb817d7e8aa41782ffb988e979b7b1623d1a1bd3d727257b581dd5ddf1a4ba
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tomato.fullname" . }}-tomato
        image: {{ .Values.tomato.tomato.image.repository }}:{{ .Values.tomato.tomato.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tomato.tomato.imagePullPolicy }}
        name: tomato
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tomato.tomato.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tomato.tomato.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tomato.fullname" . }}-tomato
  labels:
  {{- include "tomato.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tomato.type }}
  selector:
    app.kubernetes.io/instance: tomato
    app.kubernetes.io/name: herring
  {{- include "tomato.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tomato.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tomato:
  consideration: fisting
  decongestantOnline: spree
  dimpleVisual: disguise
  fashionAirspace: improvement
  fertilizerBattleshipChimpanzee: gall-bladder
  hermitLaunch: discreet
  leaverLocker: upstairs
  moan: dessert
  occurrence: ankle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  recommendRelationshipHeart: makeover
  replicas: 1
  supervisorAdvocate: breakable
  tomato:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
