# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "normalize.fullname" . }}-normalize
  labels:
  {{- include "normalize.labels" . | nindent 4 }}
data:
  EMOTION: {{ .Values.normalize.emotion | quote }}
  EVERYTHING_ANTENNAE_WALL: {{ .Values.normalize.everythingAntennaeWall | quote }}
  HARDWARE_MICRONUTRIENT: {{ .Values.normalize.hardwareMicronutrient | quote }}
  LIABILITY: {{ .Values.normalize.liability | quote }}
  PITCHING: {{ .Values.normalize.pitching | quote }}
  QUADRANT: {{ .Values.normalize.quadrant | quote }}
  SELECTIVE: {{ .Values.normalize.selective | quote }}
  SIDECAR: {{ .Values.normalize.sidecar | quote }}
  TURNING: {{ .Values.normalize.turning | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "normalize.fullname" . }}-normalize
  labels:
  {{- include "normalize.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: normalize
spec:
  replicas: {{ .Values.normalize.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: normalize
      app.kubernetes.io/name: havoc
    {{- include "normalize.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: normalize
        app.kubernetes.io/name: havoc
      {{- include "normalize.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ea05179f29b01bfd70c58e20f26f425ca4af6d917f8dbb43ad4b76bd18255b52
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "normalize.fullname" . }}-normalize
        image: {{ .Values.normalize.normalize.image.repository }}:{{ .Values.normalize.normalize.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.normalize.normalize.imagePullPolicy }}
        name: normalize
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.normalize.normalize.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.normalize.normalize.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "normalize.fullname" . }}-normalize
  labels:
  {{- include "normalize.labels" . | nindent 4 }}
spec:
  type: {{ .Values.normalize.type }}
  selector:
    app.kubernetes.io/instance: normalize
    app.kubernetes.io/name: havoc
  {{- include "normalize.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.normalize.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
normalize:
  emotion: rowing
  everythingAntennaeWall: concentration
  hardwareMicronutrient: wry
  liability: hard-hat
  normalize:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pitching: cinder
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quadrant: eyebrows
  replicas: 1
  selective: bifocals
  sidecar: offset
  turning: bottom-line
  type: ClusterIP
