# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "represent.fullname" . }}-represent
  labels:
  {{- include "represent.labels" . | nindent 4 }}
data:
  BURROW_JET_DISAGREEMENT: {{ .Values.represent.burrowJetDisagreement | quote }}
  DRAMATURGE_PSYCHIATRIST: {{ .Values.represent.dramaturgePsychiatrist | quote }}
  FRIES_PATROL_ALTERED: {{ .Values.represent.friesPatrolAltered | quote }}
  JOURNAL_RENDER_CRISIS: {{ .Values.represent.journalRenderCrisis | quote }}
  NEWSPRINT_BASEBALL_COPY: {{ .Values.represent.newsprintBaseballCopy | quote }}
  TORTILLA_STUMP_CIVILIAN: {{ .Values.represent.tortillaStumpCivilian | quote }}
  VOYAGE_PRISON: {{ .Values.represent.voyagePrison | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "represent.fullname" . }}-represent
  labels:
  {{- include "represent.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: represent
spec:
  replicas: {{ .Values.represent.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: represent
      app.kubernetes.io/name: revitalisation
    {{- include "represent.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: represent
        app.kubernetes.io/name: revitalisation
      {{- include "represent.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e88d73c7820e05dcab0dc5cca96502c5975104fdbf7a35597d45c20b43e1b395
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "represent.fullname" . }}-represent
        image: {{ .Values.represent.represent.image.repository }}:{{ .Values.represent.represent.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.represent.represent.imagePullPolicy }}
        name: represent
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.represent.represent.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.represent.represent.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "represent.fullname" . }}-represent
  labels:
  {{- include "represent.labels" . | nindent 4 }}
spec:
  type: {{ .Values.represent.type }}
  selector:
    app.kubernetes.io/instance: represent
    app.kubernetes.io/name: revitalisation
  {{- include "represent.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.represent.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
represent:
  burrowJetDisagreement: bus
  dramaturgePsychiatrist: metabolite
  friesPatrolAltered: gaming
  journalRenderCrisis: spool
  newsprintBaseballCopy: camper
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  represent:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  tortillaStumpCivilian: tennis
  type: ClusterIP
  voyagePrison: devise
