# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "reorganize.fullname" . }}-reorganize
  labels:
  {{- include "reorganize.labels" . | nindent 4 }}
data:
  ABBEY_SYNONYMOUS: {{ .Values.reorganize.abbeySynonymous | quote }}
  APPLE_CLIENT_AGGRESSION: {{ .Values.reorganize.appleClientAggression | quote }}
  EMPLOYER: {{ .Values.reorganize.employer | quote }}
  EYELINER_CUCKOO: {{ .Values.reorganize.eyelinerCuckoo | quote }}
  MISNOMER_THOUGHTLESS_ZOOLOGY: {{ .Values.reorganize.misnomerThoughtlessZoology
    | quote }}
  MONITORING_FACE_CORNFLAKES: {{ .Values.reorganize.monitoringFaceCornflakes | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "reorganize.fullname" . }}-reorganize
  labels:
  {{- include "reorganize.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: reorganize
spec:
  replicas: {{ .Values.reorganize.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: reorganize
      app.kubernetes.io/name: friendly
    {{- include "reorganize.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: reorganize
        app.kubernetes.io/name: friendly
      {{- include "reorganize.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 16088753271dd3549446ee1e4e7d4938e7643778acd6b26d576bce2a265fd5d7
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "reorganize.fullname" . }}-reorganize
        image: {{ .Values.reorganize.reorganize.image.repository }}:{{ .Values.reorganize.reorganize.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.reorganize.reorganize.imagePullPolicy }}
        name: reorganize
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.reorganize.reorganize.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.reorganize.reorganize.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "reorganize.fullname" . }}-reorganize
  labels:
  {{- include "reorganize.labels" . | nindent 4 }}
spec:
  type: {{ .Values.reorganize.type }}
  selector:
    app.kubernetes.io/instance: reorganize
    app.kubernetes.io/name: friendly
  {{- include "reorganize.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.reorganize.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
reorganize:
  abbeySynonymous: specialty
  appleClientAggression: owl
  employer: self-control
  eyelinerCuckoo: dollar
  misnomerThoughtlessZoology: audit
  monitoringFaceCornflakes: shiver
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reorganize:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  type: ClusterIP
