# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ginseng.fullname" . }}-ginseng
  labels:
  {{- include "ginseng.labels" . | nindent 4 }}
data:
  BALLOT: {{ .Values.ginseng.ballot | quote }}
  CYTOPLASM: {{ .Values.ginseng.cytoplasm | quote }}
  EXULTANT_LITTER: {{ .Values.ginseng.exultantLitter | quote }}
  GET_CONCEPTION: {{ .Values.ginseng.getConception | quote }}
  KNEE_OUTRIGGER_AXIS: {{ .Values.ginseng.kneeOutriggerAxis | quote }}
  LOCK: {{ .Values.ginseng.lock | quote }}
  OUTRAGEOUS_ICING_FORMAL: {{ .Values.ginseng.outrageousIcingFormal | quote }}
  STRUGGLE: {{ .Values.ginseng.struggle | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ginseng.fullname" . }}-ginseng
  labels:
  {{- include "ginseng.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ginseng
spec:
  replicas: {{ .Values.ginseng.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ginseng
      app.kubernetes.io/name: cheque
    {{- include "ginseng.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ginseng
        app.kubernetes.io/name: cheque
      {{- include "ginseng.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2e098efd44a27019a6c0e8e3605ed0b1b709ba93a54ce6e9a65f019370fffe87
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ginseng.fullname" . }}-ginseng
        image: {{ .Values.ginseng.ginseng.image.repository }}:{{ .Values.ginseng.ginseng.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ginseng.ginseng.imagePullPolicy }}
        name: ginseng
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ginseng.ginseng.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ginseng.ginseng.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ginseng.fullname" . }}-ginseng
  labels:
  {{- include "ginseng.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ginseng.type }}
  selector:
    app.kubernetes.io/instance: ginseng
    app.kubernetes.io/name: cheque
  {{- include "ginseng.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ginseng.ports | toYaml | nindent 2 -}}
ginseng:
  ballot: artery
  cytoplasm: dolman
  exultantLitter: mattock
  getConception: egghead
  ginseng:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  kneeOutriggerAxis: cloak
  lock: racial
  outrageousIcingFormal: mortise
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  struggle: tambour
  type: ClusterIP
kubernetesClusterDomain: cluster.local
