# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pension.fullname" . }}-pension
  labels:
  {{- include "pension.labels" . | nindent 4 }}
data:
  COLORLESSNESS_TROMBONE_MOLAR: {{ .Values.pension.colorlessnessTromboneMolar | quote
    }}
  MOAI_DISPOSAL: {{ .Values.pension.moaiDisposal | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pension.fullname" . }}-pension
  labels:
  {{- include "pension.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pension
spec:
  replicas: {{ .Values.pension.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pension
      app.kubernetes.io/name: blackness
    {{- include "pension.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pension
        app.kubernetes.io/name: blackness
      {{- include "pension.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6e20cb55c92c14c663a0f858485192801e6f28006c6fd808e758197686e22306
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pension.fullname" . }}-pension
        image: {{ .Values.pension.pension.image.repository }}:{{ .Values.pension.pension.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pension.pension.imagePullPolicy }}
        name: pension
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pension.pension.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pension.pension.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pension.fullname" . }}-pension
  labels:
  {{- include "pension.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pension.type }}
  selector:
    app.kubernetes.io/instance: pension
    app.kubernetes.io/name: blackness
  {{- include "pension.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pension.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pension:
  colorlessnessTromboneMolar: tan
  moaiDisposal: height
  pension:
    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
  replicas: 1
  type: ClusterIP
