# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "take.fullname" . }}-take
  labels:
  {{- include "take.labels" . | nindent 4 }}
data:
  BUILDING_DURIAN: {{ .Values.take.buildingDurian | quote }}
  CHARD: {{ .Values.take.chard | quote }}
  COLUMNIST_UNBIASED: {{ .Values.take.columnistUnbiased | quote }}
  FAN: {{ .Values.take.fan | quote }}
  FELLOW_DASHING_ROSTRUM: {{ .Values.take.fellowDashingRostrum | quote }}
  MANDOLIN_FLARE: {{ .Values.take.mandolinFlare | quote }}
  SCREAM: {{ .Values.take.scream | quote }}
  SPLENDID_ACCIDENTAL: {{ .Values.take.splendidAccidental | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "take.fullname" . }}-take
  labels:
  {{- include "take.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: take
spec:
  replicas: {{ .Values.take.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: take
      app.kubernetes.io/name: garlic
    {{- include "take.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: take
        app.kubernetes.io/name: garlic
      {{- include "take.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1082266fa9bf11dc67ccf44667bdf856002350842c6e9237a46fa5eb56a5be96
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "take.fullname" . }}-take
        image: {{ .Values.take.take.image.repository }}:{{ .Values.take.take.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.take.take.imagePullPolicy }}
        name: take
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.take.take.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.take.take.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "take.fullname" . }}-take
  labels:
  {{- include "take.labels" . | nindent 4 }}
spec:
  type: {{ .Values.take.type }}
  selector:
    app.kubernetes.io/instance: take
    app.kubernetes.io/name: garlic
  {{- include "take.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.take.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
take:
  buildingDurian: browsing
  chard: leave
  columnistUnbiased: keystone
  fan: spectacles
  fellowDashingRostrum: tasteful
  mandolinFlare: hero
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scream: enforce
  splendidAccidental: competition
  take:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
