# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "standpoint.fullname" . }}-standpoint
  labels:
  {{- include "standpoint.labels" . | nindent 4 }}
data:
  BEHALF_MARSHMALLOW: {{ .Values.standpoint.behalfMarshmallow | quote }}
  COMPLICITY_GENERATION_CONTEXT: {{ .Values.standpoint.complicityGenerationContext
    | quote }}
  FORTUNATE_BROKEN: {{ .Values.standpoint.fortunateBroken | quote }}
  GIFT_OTHER: {{ .Values.standpoint.giftOther | quote }}
  MAGNITUDE_FURRY_CURVED: {{ .Values.standpoint.magnitudeFurryCurved | quote }}
  OPTIMISATION: {{ .Values.standpoint.optimisation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "standpoint.fullname" . }}-standpoint
  labels:
  {{- include "standpoint.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: standpoint
spec:
  replicas: {{ .Values.standpoint.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: standpoint
      app.kubernetes.io/name: garter
    {{- include "standpoint.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: standpoint
        app.kubernetes.io/name: garter
      {{- include "standpoint.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 91a02e91152e121e82fc5ffa6bea99dbc0bd3cfa95d6dd71bac26d5dd865d7a4
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "standpoint.fullname" . }}-standpoint
        image: {{ .Values.standpoint.standpoint.image.repository }}:{{ .Values.standpoint.standpoint.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.standpoint.standpoint.imagePullPolicy }}
        name: standpoint
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.standpoint.standpoint.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.standpoint.standpoint.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "standpoint.fullname" . }}-standpoint
  labels:
  {{- include "standpoint.labels" . | nindent 4 }}
spec:
  type: {{ .Values.standpoint.type }}
  selector:
    app.kubernetes.io/instance: standpoint
    app.kubernetes.io/name: garter
  {{- include "standpoint.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.standpoint.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
standpoint:
  behalfMarshmallow: diction
  complicityGenerationContext: solitaire
  fortunateBroken: bench
  giftOther: frame
  magnitudeFurryCurved: asparagus
  optimisation: cosset
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  standpoint:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
