# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "grapefruit.fullname" . }}-grapefruit
  labels:
  {{- include "grapefruit.labels" . | nindent 4 }}
data:
  CHIEF_STYLUS: {{ .Values.grapefruit.chiefStylus | quote }}
  ELIGIBILITY_MIND: {{ .Values.grapefruit.eligibilityMind | quote }}
  NORTH_TWIG: {{ .Values.grapefruit.northTwig | quote }}
  PERCENT_PARTRIDGE: {{ .Values.grapefruit.percentPartridge | quote }}
  SECURITY_REGISTRY_GELDING: {{ .Values.grapefruit.securityRegistryGelding | quote
    }}
  SWORD_CATCHER_HAPPENING: {{ .Values.grapefruit.swordCatcherHappening | quote }}
  VAGUE_COMPUTER: {{ .Values.grapefruit.vagueComputer | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "grapefruit.fullname" . }}-grapefruit
  labels:
  {{- include "grapefruit.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: grapefruit
spec:
  replicas: {{ .Values.grapefruit.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: grapefruit
      app.kubernetes.io/name: stride
    {{- include "grapefruit.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: grapefruit
        app.kubernetes.io/name: stride
      {{- include "grapefruit.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: fab2408f710169f2f70b726d4337b6e023de695bad2be92af860ae48a7d50cf3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "grapefruit.fullname" . }}-grapefruit
        image: {{ .Values.grapefruit.grapefruit.image.repository }}:{{ .Values.grapefruit.grapefruit.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.grapefruit.grapefruit.imagePullPolicy }}
        name: grapefruit
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.grapefruit.grapefruit.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.grapefruit.grapefruit.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "grapefruit.fullname" . }}-grapefruit
  labels:
  {{- include "grapefruit.labels" . | nindent 4 }}
spec:
  type: {{ .Values.grapefruit.type }}
  selector:
    app.kubernetes.io/instance: grapefruit
    app.kubernetes.io/name: stride
  {{- include "grapefruit.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.grapefruit.ports | toYaml | nindent 2 -}}
grapefruit:
  chiefStylus: vague
  eligibilityMind: freelance
  grapefruit:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  northTwig: line
  percentPartridge: rocket
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  securityRegistryGelding: question
  swordCatcherHappening: blessing
  type: ClusterIP
  vagueComputer: glimpse
kubernetesClusterDomain: cluster.local
