# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "certification.fullname" . }}-certification
  labels:
  {{- include "certification.labels" . | nindent 4 }}
data:
  COMEBACK: {{ .Values.certification.comeback | quote }}
  RATE_COLLABORATION_SORROW: {{ .Values.certification.rateCollaborationSorrow | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "certification.fullname" . }}-certification
  labels:
  {{- include "certification.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: certification
spec:
  replicas: {{ .Values.certification.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: certification
      app.kubernetes.io/name: blast
    {{- include "certification.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: certification
        app.kubernetes.io/name: blast
      {{- include "certification.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 08da55de06ff8fba84559b46d22180a3a51d8601a81a9b1d88bee84bf4894881
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "certification.fullname" . }}-certification
        image: {{ .Values.certification.certification.image.repository }}:{{ .Values.certification.certification.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.certification.certification.imagePullPolicy }}
        name: certification
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.certification.certification.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.certification.certification.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "certification.fullname" . }}-certification
  labels:
  {{- include "certification.labels" . | nindent 4 }}
spec:
  type: {{ .Values.certification.type }}
  selector:
    app.kubernetes.io/instance: certification
    app.kubernetes.io/name: blast
  {{- include "certification.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.certification.ports | toYaml | nindent 2 -}}
certification:
  certification:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  comeback: miter
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rateCollaborationSorrow: verification
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
