# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "comment.fullname" . }}-comment
  labels:
  {{- include "comment.labels" . | nindent 4 }}
data:
  EDITED_CONNOTATION_CONTAINER: {{ .Values.comment.editedConnotationContainer | quote
    }}
  IMPERFECT: {{ .Values.comment.imperfect | quote }}
  POWDER: {{ .Values.comment.powder | quote }}
  TILL: {{ .Values.comment.till | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "comment.fullname" . }}-comment
  labels:
  {{- include "comment.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: comment
spec:
  replicas: {{ .Values.comment.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: comment
      app.kubernetes.io/name: nucleotide
    {{- include "comment.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: comment
        app.kubernetes.io/name: nucleotide
      {{- include "comment.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cb8aceab8059260f67933640948a405995ac06a9929f3800d1b1e96e4551bfa5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "comment.fullname" . }}-comment
        image: {{ .Values.comment.comment.image.repository }}:{{ .Values.comment.comment.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.comment.comment.imagePullPolicy }}
        name: comment
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.comment.comment.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.comment.comment.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "comment.fullname" . }}-comment
  labels:
  {{- include "comment.labels" . | nindent 4 }}
spec:
  type: {{ .Values.comment.type }}
  selector:
    app.kubernetes.io/instance: comment
    app.kubernetes.io/name: nucleotide
  {{- include "comment.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.comment.ports | toYaml | nindent 2 -}}
comment:
  comment:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  editedConnotationContainer: court
  imperfect: cartload
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  powder: bladder
  replicas: 1
  till: corn
  type: ClusterIP
kubernetesClusterDomain: cluster.local
