# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "memorize.fullname" . }}-memorize
  labels:
  {{- include "memorize.labels" . | nindent 4 }}
data:
  BANYAN: {{ .Values.memorize.banyan | quote }}
  BINOCULARS_HARBOR: {{ .Values.memorize.binocularsHarbor | quote }}
  BOOTY: {{ .Values.memorize.booty | quote }}
  DEER_WORSHIPER_MEDAL: {{ .Values.memorize.deerWorshiperMedal | quote }}
  HUMIDITY_DISTRIBUTION: {{ .Values.memorize.humidityDistribution | quote }}
  NEEDLE_PILE_NICKNAME: {{ .Values.memorize.needlePileNickname | quote }}
  PERFECT_SATELLITE: {{ .Values.memorize.perfectSatellite | quote }}
  SPECTACULAR_ADRENALIN: {{ .Values.memorize.spectacularAdrenalin | quote }}
  SWIMMING_GEMSBOK_MYSTERY: {{ .Values.memorize.swimmingGemsbokMystery | quote }}
  YOGURT: {{ .Values.memorize.yogurt | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "memorize.fullname" . }}-memorize
  labels:
  {{- include "memorize.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: memorize
spec:
  replicas: {{ .Values.memorize.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: memorize
      app.kubernetes.io/name: lawmaker
    {{- include "memorize.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: memorize
        app.kubernetes.io/name: lawmaker
      {{- include "memorize.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2fcb1d14dff9779edab26ac8e658ad47e8c8baa8f973636afabfd482ddc679c3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "memorize.fullname" . }}-memorize
        image: {{ .Values.memorize.memorize.image.repository }}:{{ .Values.memorize.memorize.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.memorize.memorize.imagePullPolicy }}
        name: memorize
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.memorize.memorize.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.memorize.memorize.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "memorize.fullname" . }}-memorize
  labels:
  {{- include "memorize.labels" . | nindent 4 }}
spec:
  type: {{ .Values.memorize.type }}
  selector:
    app.kubernetes.io/instance: memorize
    app.kubernetes.io/name: lawmaker
  {{- include "memorize.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.memorize.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
memorize:
  banyan: botany
  binocularsHarbor: haircut
  booty: eyebrows
  deerWorshiperMedal: omelet
  humidityDistribution: practice
  memorize:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  needlePileNickname: sphynx
  perfectSatellite: identification
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  spectacularAdrenalin: polarization
  swimmingGemsbokMystery: style
  type: ClusterIP
  yogurt: belly
