# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "selective.fullname" . }}-selective
  labels:
  {{- include "selective.labels" . | nindent 4 }}
data:
  BRUSHING: {{ .Values.selective.brushing | quote }}
  CORNERSTONE_SCALE: {{ .Values.selective.cornerstoneScale | quote }}
  GRAFT: {{ .Values.selective.graft | quote }}
  GUITARIST_BATTALION_CROISSANT: {{ .Values.selective.guitaristBattalionCroissant
    | quote }}
  GYRO_HALL: {{ .Values.selective.gyroHall | quote }}
  MOWER_ATTEMPT_HOUSING: {{ .Values.selective.mowerAttemptHousing | quote }}
  OUTFIT: {{ .Values.selective.outfit | quote }}
  POUCH_BELT: {{ .Values.selective.pouchBelt | quote }}
  PRECIPITATION_RANGER: {{ .Values.selective.precipitationRanger | quote }}
  RANCH_TUNIC: {{ .Values.selective.ranchTunic | quote }}
  TIRESOME_DESSERT: {{ .Values.selective.tiresomeDessert | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "selective.fullname" . }}-selective
  labels:
  {{- include "selective.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: selective
spec:
  replicas: {{ .Values.selective.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: selective
      app.kubernetes.io/name: celsius
    {{- include "selective.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: selective
        app.kubernetes.io/name: celsius
      {{- include "selective.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a94ff8f651ce377dddcb1aa124ba3e2c9ac2ca2fe1801229b8330dd679343d25
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "selective.fullname" . }}-selective
        image: {{ .Values.selective.selective.image.repository }}:{{ .Values.selective.selective.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.selective.selective.imagePullPolicy }}
        name: selective
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.selective.selective.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.selective.selective.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "selective.fullname" . }}-selective
  labels:
  {{- include "selective.labels" . | nindent 4 }}
spec:
  type: {{ .Values.selective.type }}
  selector:
    app.kubernetes.io/instance: selective
    app.kubernetes.io/name: celsius
  {{- include "selective.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.selective.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
selective:
  brushing: assassination
  cornerstoneScale: show-stopper
  graft: dude
  guitaristBattalionCroissant: exclusive
  gyroHall: labour
  mowerAttemptHousing: biscuit
  outfit: learn
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pouchBelt: finger
  precipitationRanger: excellent
  ranchTunic: workplace
  replicas: 1
  selective:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  tiresomeDessert: temporariness
  type: ClusterIP
