# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "attorney.fullname" . }}-attorney
  labels:
  {{- include "attorney.labels" . | nindent 4 }}
data:
  AUTHORIZATION_INSOMNIA: {{ .Values.attorney.authorizationInsomnia | quote }}
  CAPPELLETTI: {{ .Values.attorney.cappelletti | quote }}
  CONFECTIONERY: {{ .Values.attorney.confectionery | quote }}
  MANY_VIRTUE_PRODUCTION: {{ .Values.attorney.manyVirtueProduction | quote }}
  MIST: {{ .Values.attorney.mist | quote }}
  NEXUS: {{ .Values.attorney.nexus | quote }}
  OFFERING: {{ .Values.attorney.offering | quote }}
  PRIZE_PLEA_STAMP: {{ .Values.attorney.prizePleaStamp | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "attorney.fullname" . }}-attorney
  labels:
  {{- include "attorney.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: attorney
spec:
  replicas: {{ .Values.attorney.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: attorney
      app.kubernetes.io/name: pressurisation
    {{- include "attorney.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: attorney
        app.kubernetes.io/name: pressurisation
      {{- include "attorney.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ba63aac563c1f5ea17aa6e7c4c0243b2bd23422dd20acded5010dead27a4a590
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "attorney.fullname" . }}-attorney
        image: {{ .Values.attorney.attorney.image.repository }}:{{ .Values.attorney.attorney.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.attorney.attorney.imagePullPolicy }}
        name: attorney
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.attorney.attorney.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.attorney.attorney.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "attorney.fullname" . }}-attorney
  labels:
  {{- include "attorney.labels" . | nindent 4 }}
spec:
  type: {{ .Values.attorney.type }}
  selector:
    app.kubernetes.io/instance: attorney
    app.kubernetes.io/name: pressurisation
  {{- include "attorney.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.attorney.ports | toYaml | nindent 2 -}}
attorney:
  attorney:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  authorizationInsomnia: hugger
  cappelletti: veil
  confectionery: campus
  manyVirtueProduction: lynx
  mist: euphonium
  nexus: dolphin
  offering: numberless
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  prizePleaStamp: spy
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
