# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "management.fullname" . }}-management
  labels:
  {{- include "management.labels" . | nindent 4 }}
data:
  CELEBRITY: {{ .Values.management.celebrity | quote }}
  REDESIGN: {{ .Values.management.redesign | quote }}
  SEAT_MENORAH_RATIO: {{ .Values.management.seatMenorahRatio | quote }}
  VODKA_PURITAN_FUGATO: {{ .Values.management.vodkaPuritanFugato | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "management.fullname" . }}-management
  labels:
  {{- include "management.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: management
spec:
  replicas: {{ .Values.management.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: management
      app.kubernetes.io/name: secretary
    {{- include "management.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: management
        app.kubernetes.io/name: secretary
      {{- include "management.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c662eb5a8e0172e75a0fb9fef839cb624c910d26e4f7b6d95fcc0df9f8d7f425
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "management.fullname" . }}-management
        image: {{ .Values.management.management.image.repository }}:{{ .Values.management.management.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.management.management.imagePullPolicy }}
        name: management
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.management.management.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.management.management.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "management.fullname" . }}-management
  labels:
  {{- include "management.labels" . | nindent 4 }}
spec:
  type: {{ .Values.management.type }}
  selector:
    app.kubernetes.io/instance: management
    app.kubernetes.io/name: secretary
  {{- include "management.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.management.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
management:
  celebrity: elfin
  management:
    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
  redesign: executor
  replicas: 1
  seatMenorahRatio: interface
  type: ClusterIP
  vodkaPuritanFugato: belong
