# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "feature.fullname" . }}-feature
  labels:
  {{- include "feature.labels" . | nindent 4 }}
data:
  BOUGH: {{ .Values.feature.bough | quote }}
  BOYCOTT_LIMO_CALCIFICATION: {{ .Values.feature.boycottLimoCalcification | quote
    }}
  CASUALTY_GLACIER_TROUBLESHOOT: {{ .Values.feature.casualtyGlacierTroubleshoot |
    quote }}
  DRAINAGE: {{ .Values.feature.drainage | quote }}
  DUGOUT_WORKING_EGG: {{ .Values.feature.dugoutWorkingEgg | quote }}
  KARATE: {{ .Values.feature.karate | quote }}
  PLATTER_SELECTION_DECADENCE: {{ .Values.feature.platterSelectionDecadence | quote
    }}
  PROVISION: {{ .Values.feature.provision | quote }}
  SOFTDRINK_DRIZZLE_STEPDAUGHTER: {{ .Values.feature.softdrinkDrizzleStepdaughter
    | quote }}
  WILDLIFE_CHARGER_PREFIX: {{ .Values.feature.wildlifeChargerPrefix | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "feature.fullname" . }}-feature
  labels:
  {{- include "feature.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: feature
spec:
  replicas: {{ .Values.feature.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: feature
      app.kubernetes.io/name: graduate
    {{- include "feature.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: feature
        app.kubernetes.io/name: graduate
      {{- include "feature.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 90ab19781c479d565430bc9363288ef0ba232745fd4b4aca9e6934704db2a3c5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "feature.fullname" . }}-feature
        image: {{ .Values.feature.feature.image.repository }}:{{ .Values.feature.feature.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.feature.feature.imagePullPolicy }}
        name: feature
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.feature.feature.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.feature.feature.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "feature.fullname" . }}-feature
  labels:
  {{- include "feature.labels" . | nindent 4 }}
spec:
  type: {{ .Values.feature.type }}
  selector:
    app.kubernetes.io/instance: feature
    app.kubernetes.io/name: graduate
  {{- include "feature.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.feature.ports | toYaml | nindent 2 -}}
feature:
  bough: nutritious
  boycottLimoCalcification: dynamics
  casualtyGlacierTroubleshoot: codling
  drainage: trunk
  dugoutWorkingEgg: muddy
  feature:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  karate: stuff
  platterSelectionDecadence: electronics
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  provision: wonder
  replicas: 1
  softdrinkDrizzleStepdaughter: snowboarding
  type: ClusterIP
  wildlifeChargerPrefix: spool
kubernetesClusterDomain: cluster.local
