# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "perspective.fullname" . }}-perspective
  labels:
  {{- include "perspective.labels" . | nindent 4 }}
data:
  ALGORITHM_OPPORTUNIST: {{ .Values.perspective.algorithmOpportunist | quote }}
  BUTCHER: {{ .Values.perspective.butcher | quote }}
  FLUTTERING_ERECTION_DART: {{ .Values.perspective.flutteringErectionDart | quote
    }}
  NEXUS_KICK-OFF: {{ .Values.perspective.nexusKickOff | quote }}
  PAWNSHOP_SILO_CREWMEN: {{ .Values.perspective.pawnshopSiloCrewmen | quote }}
  SYMBOLIZE_HOMETOWN: {{ .Values.perspective.symbolizeHometown | quote }}
  YEAR_STEEP: {{ .Values.perspective.yearSteep | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "perspective.fullname" . }}-perspective
  labels:
  {{- include "perspective.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: perspective
spec:
  replicas: {{ .Values.perspective.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: perspective
      app.kubernetes.io/name: decision-making
    {{- include "perspective.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: perspective
        app.kubernetes.io/name: decision-making
      {{- include "perspective.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0829aa427cfd57724d978d90220cc75d804143e3a1416a67c3a0a3b3b8a3945d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "perspective.fullname" . }}-perspective
        image: {{ .Values.perspective.perspective.image.repository }}:{{ .Values.perspective.perspective.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.perspective.perspective.imagePullPolicy }}
        name: perspective
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.perspective.perspective.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.perspective.perspective.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "perspective.fullname" . }}-perspective
  labels:
  {{- include "perspective.labels" . | nindent 4 }}
spec:
  type: {{ .Values.perspective.type }}
  selector:
    app.kubernetes.io/instance: perspective
    app.kubernetes.io/name: decision-making
  {{- include "perspective.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.perspective.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
perspective:
  algorithmOpportunist: gong
  butcher: overflow
  flutteringErectionDart: dizzy
  nexusKickOff: indigence
  pawnshopSiloCrewmen: savage
  perspective:
    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
  replicas: 1
  symbolizeHometown: ink
  type: ClusterIP
  yearSteep: ambiguity
