# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "gradient.fullname" . }}-gradient
  labels:
  {{- include "gradient.labels" . | nindent 4 }}
data:
  BOX_PEACH: {{ .Values.gradient.boxPeach | quote }}
  CHARITY_WATERFRONT: {{ .Values.gradient.charityWaterfront | quote }}
  DEPRESSIVE_RELISH_SCIENTIST: {{ .Values.gradient.depressiveRelishScientist | quote
    }}
  GIFT: {{ .Values.gradient.gift | quote }}
  MISREPRESENTATION: {{ .Values.gradient.misrepresentation | quote }}
  RAINCOAT_OPERATOR_STRIKE: {{ .Values.gradient.raincoatOperatorStrike | quote }}
  REMINDER: {{ .Values.gradient.reminder | quote }}
  ROMANTIC_CASEMENT_KIT: {{ .Values.gradient.romanticCasementKit | quote }}
  SAIL_BLUE: {{ .Values.gradient.sailBlue | quote }}
  SCENT_CHILI_LILY: {{ .Values.gradient.scentChiliLily | quote }}
  TUMBLE_PLACEBO: {{ .Values.gradient.tumblePlacebo | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "gradient.fullname" . }}-gradient
  labels:
  {{- include "gradient.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: gradient
spec:
  replicas: {{ .Values.gradient.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: gradient
      app.kubernetes.io/name: process
    {{- include "gradient.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: gradient
        app.kubernetes.io/name: process
      {{- include "gradient.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6b57ed16c39841d11983402c725c4c410ef886af2ed4f73b2a56cd169ca88ff0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "gradient.fullname" . }}-gradient
        image: {{ .Values.gradient.gradient.image.repository }}:{{ .Values.gradient.gradient.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.gradient.gradient.imagePullPolicy }}
        name: gradient
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.gradient.gradient.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.gradient.gradient.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "gradient.fullname" . }}-gradient
  labels:
  {{- include "gradient.labels" . | nindent 4 }}
spec:
  type: {{ .Values.gradient.type }}
  selector:
    app.kubernetes.io/instance: gradient
    app.kubernetes.io/name: process
  {{- include "gradient.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.gradient.ports | toYaml | nindent 2 -}}
gradient:
  boxPeach: spill
  charityWaterfront: biplane
  depressiveRelishScientist: needy
  gift: supernatural
  gradient:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  misrepresentation: associate
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  raincoatOperatorStrike: log
  reminder: therapist
  replicas: 1
  romanticCasementKit: marketing
  sailBlue: armoire
  scentChiliLily: wetland
  tumblePlacebo: glockenspiel
  type: ClusterIP
kubernetesClusterDomain: cluster.local
