# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "profile.fullname" . }}-profile
  labels:
  {{- include "profile.labels" . | nindent 4 }}
data:
  ACRID_RHYME_GEM: {{ .Values.profile.acridRhymeGem | quote }}
  PET_CLOVE_MARKETER: {{ .Values.profile.petCloveMarketer | quote }}
  PREPARATION_SPENDING_BIPLANE: {{ .Values.profile.preparationSpendingBiplane | quote
    }}
  RESOLUTE_STUD_INNOVATE: {{ .Values.profile.resoluteStudInnovate | quote }}
  TECHNOLOGY_COUGH_HUMDRUM: {{ .Values.profile.technologyCoughHumdrum | quote }}
  TIMBER: {{ .Values.profile.timber | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "profile.fullname" . }}-profile
  labels:
  {{- include "profile.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: profile
spec:
  replicas: {{ .Values.profile.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: profile
      app.kubernetes.io/name: neighborly
    {{- include "profile.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: profile
        app.kubernetes.io/name: neighborly
      {{- include "profile.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1738f17c27e09e5c040b8399197ddbda4c37259dcc6701dd5c2fca72682ec895
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "profile.fullname" . }}-profile
        image: {{ .Values.profile.profile.image.repository }}:{{ .Values.profile.profile.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.profile.profile.imagePullPolicy }}
        name: profile
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.profile.profile.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.profile.profile.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "profile.fullname" . }}-profile
  labels:
  {{- include "profile.labels" . | nindent 4 }}
spec:
  type: {{ .Values.profile.type }}
  selector:
    app.kubernetes.io/instance: profile
    app.kubernetes.io/name: neighborly
  {{- include "profile.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.profile.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
profile:
  acridRhymeGem: adviser
  petCloveMarketer: lazy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preparationSpendingBiplane: census
  profile:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  resoluteStudInnovate: overdraw
  technologyCoughHumdrum: sniffle
  timber: chair
  type: ClusterIP
