# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "grin.fullname" . }}-grin
  labels:
  {{- include "grin.labels" . | nindent 4 }}
data:
  EASE_SPECIFY_GROCERY: {{ .Values.grin.easeSpecifyGrocery | quote }}
  GRAMMAR: {{ .Values.grin.grammar | quote }}
  HIGH: {{ .Values.grin.high | quote }}
  HURRICANE_TOPIC_PAYOFF: {{ .Values.grin.hurricaneTopicPayoff | quote }}
  PEACE_POOL: {{ .Values.grin.peacePool | quote }}
  QUEEN_COMPONENT_UNDERWEAR: {{ .Values.grin.queenComponentUnderwear | quote }}
  WASTEBASKET_ALTERNATIVE: {{ .Values.grin.wastebasketAlternative | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "grin.fullname" . }}-grin
  labels:
  {{- include "grin.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: grin
spec:
  replicas: {{ .Values.grin.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: grin
      app.kubernetes.io/name: shell
    {{- include "grin.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: grin
        app.kubernetes.io/name: shell
      {{- include "grin.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 64dcb6646d52a14e77ad5d77477d109e2e048f4ef0952e6f57e2761cdfd68ff3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "grin.fullname" . }}-grin
        image: {{ .Values.grin.grin.image.repository }}:{{ .Values.grin.grin.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.grin.grin.imagePullPolicy }}
        name: grin
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.grin.grin.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.grin.grin.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "grin.fullname" . }}-grin
  labels:
  {{- include "grin.labels" . | nindent 4 }}
spec:
  type: {{ .Values.grin.type }}
  selector:
    app.kubernetes.io/instance: grin
    app.kubernetes.io/name: shell
  {{- include "grin.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.grin.ports | toYaml | nindent 2 -}}
grin:
  easeSpecifyGrocery: alfalfa
  grammar: value
  grin:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  high: election
  hurricaneTopicPayoff: strategy
  peacePool: sniff
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  queenComponentUnderwear: belligerent
  replicas: 1
  type: ClusterIP
  wastebasketAlternative: acquire
kubernetesClusterDomain: cluster.local
