# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "counseling.fullname" . }}-counseling
  labels:
  {{- include "counseling.labels" . | nindent 4 }}
data:
  BOTTLING_GENTLE: {{ .Values.counseling.bottlingGentle | quote }}
  CHESS: {{ .Values.counseling.chess | quote }}
  HOLE_VIOLET_FRIGHTEN: {{ .Values.counseling.holeVioletFrighten | quote }}
  IMPLICATION_SHALLOT: {{ .Values.counseling.implicationShallot | quote }}
  MANOR: {{ .Values.counseling.manor | quote }}
  VOLATILITY_CARBON_FOOT: {{ .Values.counseling.volatilityCarbonFoot | quote }}
  WAIT_NETSUKE: {{ .Values.counseling.waitNetsuke | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "counseling.fullname" . }}-counseling
  labels:
  {{- include "counseling.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: counseling
spec:
  replicas: {{ .Values.counseling.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: counseling
      app.kubernetes.io/name: message
    {{- include "counseling.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: counseling
        app.kubernetes.io/name: message
      {{- include "counseling.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7f8e9fddaf1b12194a8fdf25c926feb8df724af7bce6898eed4a6bd4cb38557d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "counseling.fullname" . }}-counseling
        image: {{ .Values.counseling.counseling.image.repository }}:{{ .Values.counseling.counseling.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.counseling.counseling.imagePullPolicy }}
        name: counseling
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.counseling.counseling.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.counseling.counseling.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "counseling.fullname" . }}-counseling
  labels:
  {{- include "counseling.labels" . | nindent 4 }}
spec:
  type: {{ .Values.counseling.type }}
  selector:
    app.kubernetes.io/instance: counseling
    app.kubernetes.io/name: message
  {{- include "counseling.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.counseling.ports | toYaml | nindent 2 -}}
counseling:
  bottlingGentle: anarchist
  chess: assessment
  counseling:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  holeVioletFrighten: document
  implicationShallot: gymnast
  manor: ophthalmologist
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  volatilityCarbonFoot: hold
  waitNetsuke: clamp
kubernetesClusterDomain: cluster.local
