# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pretend.fullname" . }}-pretend
  labels:
  {{- include "pretend.labels" . | nindent 4 }}
data:
  AGLET_CUTTING: {{ .Values.pretend.agletCutting | quote }}
  ARGUE_NOSY: {{ .Values.pretend.argueNosy | quote }}
  BAMBOO_SPIRITUALITY_DISCOURSE: {{ .Values.pretend.bambooSpiritualityDiscourse |
    quote }}
  DESSERT_VIGNETTE_COMMANDMENT: {{ .Values.pretend.dessertVignetteCommandment | quote
    }}
  STORY_QUEST_SINGER: {{ .Values.pretend.storyQuestSinger | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pretend.fullname" . }}-pretend
  labels:
  {{- include "pretend.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pretend
spec:
  replicas: {{ .Values.pretend.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pretend
      app.kubernetes.io/name: tuber
    {{- include "pretend.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pretend
        app.kubernetes.io/name: tuber
      {{- include "pretend.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0794f282fd0df1af9ffeec4aa96ca3bf9fbaadaef5f3668f01422c93ecaca0ea
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pretend.fullname" . }}-pretend
        image: {{ .Values.pretend.pretend.image.repository }}:{{ .Values.pretend.pretend.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pretend.pretend.imagePullPolicy }}
        name: pretend
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pretend.pretend.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pretend.pretend.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pretend.fullname" . }}-pretend
  labels:
  {{- include "pretend.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pretend.type }}
  selector:
    app.kubernetes.io/instance: pretend
    app.kubernetes.io/name: tuber
  {{- include "pretend.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pretend.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pretend:
  agletCutting: implication
  argueNosy: enthusiastic
  bambooSpiritualityDiscourse: duck
  dessertVignetteCommandment: ascend
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pretend:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  storyQuestSinger: skill
  type: ClusterIP
