# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "insight.fullname" . }}-insight
  labels:
  {{- include "insight.labels" . | nindent 4 }}
data:
  CANDIDATE_FIXTURE: {{ .Values.insight.candidateFixture | quote }}
  CHAPTER: {{ .Values.insight.chapter | quote }}
  IRONCLAD_CONSPIRACY: {{ .Values.insight.ironcladConspiracy | quote }}
  NEGOTIATE_HOSPITALISATION: {{ .Values.insight.negotiateHospitalisation | quote
    }}
  NEGOTIATE_SEAWEED: {{ .Values.insight.negotiateSeaweed | quote }}
  TOOTHPICK_COPYING_ARCHIVES: {{ .Values.insight.toothpickCopyingArchives | quote
    }}
  VERVE: {{ .Values.insight.verve | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "insight.fullname" . }}-insight
  labels:
  {{- include "insight.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: insight
spec:
  replicas: {{ .Values.insight.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: insight
      app.kubernetes.io/name: macrame
    {{- include "insight.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: insight
        app.kubernetes.io/name: macrame
      {{- include "insight.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 345f705b9e6a0ffef6ce876001bb611035c8bbc3c5cf3d3da8da4c17317893d3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "insight.fullname" . }}-insight
        image: {{ .Values.insight.insight.image.repository }}:{{ .Values.insight.insight.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.insight.insight.imagePullPolicy }}
        name: insight
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.insight.insight.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.insight.insight.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "insight.fullname" . }}-insight
  labels:
  {{- include "insight.labels" . | nindent 4 }}
spec:
  type: {{ .Values.insight.type }}
  selector:
    app.kubernetes.io/instance: insight
    app.kubernetes.io/name: macrame
  {{- include "insight.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.insight.ports | toYaml | nindent 2 -}}
insight:
  candidateFixture: orator
  chapter: retire
  insight:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ironcladConspiracy: receptive
  negotiateHospitalisation: alert
  negotiateSeaweed: imperfect
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  toothpickCopyingArchives: professor
  type: ClusterIP
  verve: drug
kubernetesClusterDomain: cluster.local
