# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "particle.fullname" . }}-particle
  labels:
  {{- include "particle.labels" . | nindent 4 }}
data:
  CROSS_CHILDHOOD_THOUGHTLESS: {{ .Values.particle.crossChildhoodThoughtless | quote
    }}
  DUCKLING: {{ .Values.particle.duckling | quote }}
  FLASH: {{ .Values.particle.flash | quote }}
  IMMIGRANT: {{ .Values.particle.immigrant | quote }}
  METHOD: {{ .Values.particle.method | quote }}
  RACIAL: {{ .Values.particle.racial | quote }}
  SELLING_MEAL: {{ .Values.particle.sellingMeal | quote }}
  SPAN_TUMMY: {{ .Values.particle.spanTummy | quote }}
  SUCCOTASH_CULTIVATOR: {{ .Values.particle.succotashCultivator | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "particle.fullname" . }}-particle
  labels:
  {{- include "particle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: particle
spec:
  replicas: {{ .Values.particle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: particle
      app.kubernetes.io/name: gaffe
    {{- include "particle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: particle
        app.kubernetes.io/name: gaffe
      {{- include "particle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 165efb55206858c621fb917266eb56e7b524618967bb52bce28c76b1331cb565
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "particle.fullname" . }}-particle
        image: {{ .Values.particle.particle.image.repository }}:{{ .Values.particle.particle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.particle.particle.imagePullPolicy }}
        name: particle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.particle.particle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.particle.particle.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "particle.fullname" . }}-particle
  labels:
  {{- include "particle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.particle.type }}
  selector:
    app.kubernetes.io/instance: particle
    app.kubernetes.io/name: gaffe
  {{- include "particle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.particle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
particle:
  crossChildhoodThoughtless: progress
  duckling: moody
  flash: sleeping
  immigrant: barracks
  method: grip
  particle:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  racial: orange
  replicas: 1
  sellingMeal: swordfight
  spanTummy: dollop
  succotashCultivator: conference
  type: ClusterIP
