# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "derivative.fullname" . }}-derivative
  labels:
  {{- include "derivative.labels" . | nindent 4 }}
data:
  CANDY_TRUNK_ASSERTION: {{ .Values.derivative.candyTrunkAssertion | quote }}
  MEDICINE: {{ .Values.derivative.medicine | quote }}
  MINERAL_PENITENT_ELLIPSE: {{ .Values.derivative.mineralPenitentEllipse | quote
    }}
  OCCUPATION_SEASON_JAGGED: {{ .Values.derivative.occupationSeasonJagged | quote
    }}
  REGIONALISM_ROAST: {{ .Values.derivative.regionalismRoast | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "derivative.fullname" . }}-derivative
  labels:
  {{- include "derivative.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: derivative
spec:
  replicas: {{ .Values.derivative.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: derivative
      app.kubernetes.io/name: candidacy
    {{- include "derivative.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: derivative
        app.kubernetes.io/name: candidacy
      {{- include "derivative.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 445e48bcb9f78085da90de4f761960e442e7a0ae72eedaaebe1f766618941132
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "derivative.fullname" . }}-derivative
        image: {{ .Values.derivative.derivative.image.repository }}:{{ .Values.derivative.derivative.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.derivative.derivative.imagePullPolicy }}
        name: derivative
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.derivative.derivative.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.derivative.derivative.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "derivative.fullname" . }}-derivative
  labels:
  {{- include "derivative.labels" . | nindent 4 }}
spec:
  type: {{ .Values.derivative.type }}
  selector:
    app.kubernetes.io/instance: derivative
    app.kubernetes.io/name: candidacy
  {{- include "derivative.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.derivative.ports | toYaml | nindent 2 -}}
derivative:
  candyTrunkAssertion: noir
  derivative:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  medicine: snug
  mineralPenitentEllipse: hackwork
  occupationSeasonJagged: drum
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  regionalismRoast: ethyl
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
