# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "revenant.fullname" . }}-revenant
  labels:
  {{- include "revenant.labels" . | nindent 4 }}
data:
  MILLET_ARM-REST_ADDITION: {{ .Values.revenant.milletArmRestAddition | quote }}
  SPIFFY_TAX_ROBUST: {{ .Values.revenant.spiffyTaxRobust | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "revenant.fullname" . }}-revenant
  labels:
  {{- include "revenant.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: revenant
spec:
  replicas: {{ .Values.revenant.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: revenant
      app.kubernetes.io/name: equinox
    {{- include "revenant.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: revenant
        app.kubernetes.io/name: equinox
      {{- include "revenant.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2a63b916c03cd804b04ba789632a17a95420b38876bc2fa7b15485b6a9210429
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "revenant.fullname" . }}-revenant
        image: {{ .Values.revenant.revenant.image.repository }}:{{ .Values.revenant.revenant.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.revenant.revenant.imagePullPolicy }}
        name: revenant
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.revenant.revenant.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.revenant.revenant.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "revenant.fullname" . }}-revenant
  labels:
  {{- include "revenant.labels" . | nindent 4 }}
spec:
  type: {{ .Values.revenant.type }}
  selector:
    app.kubernetes.io/instance: revenant
    app.kubernetes.io/name: equinox
  {{- include "revenant.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.revenant.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
revenant:
  milletArmRestAddition: fault
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  revenant:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  spiffyTaxRobust: campus
  type: ClusterIP
