# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "oar.fullname" . }}-oar
  labels:
  {{- include "oar.labels" . | nindent 4 }}
data:
  BOOKLET_REORGANISATION: {{ .Values.oar.bookletReorganisation | quote }}
  CAMPAIGN: {{ .Values.oar.campaign | quote }}
  CATALYST_RAGGED: {{ .Values.oar.catalystRagged | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "oar.fullname" . }}-oar
  labels:
  {{- include "oar.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: oar
spec:
  replicas: {{ .Values.oar.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: oar
      app.kubernetes.io/name: crisp
    {{- include "oar.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: oar
        app.kubernetes.io/name: crisp
      {{- include "oar.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4f2bf0b41a765d8685945126d001d481254fbd7259c832e9539b8243b4769c2a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "oar.fullname" . }}-oar
        image: {{ .Values.oar.oar.image.repository }}:{{ .Values.oar.oar.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.oar.oar.imagePullPolicy }}
        name: oar
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.oar.oar.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.oar.oar.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "oar.fullname" . }}-oar
  labels:
  {{- include "oar.labels" . | nindent 4 }}
spec:
  type: {{ .Values.oar.type }}
  selector:
    app.kubernetes.io/instance: oar
    app.kubernetes.io/name: crisp
  {{- include "oar.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.oar.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
oar:
  bookletReorganisation: mistake
  campaign: bidder
  catalystRagged: disapprove
  oar:
    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
  type: ClusterIP
