# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "testy.fullname" . }}-testy
  labels:
  {{- include "testy.labels" . | nindent 4 }}
data:
  DAYBED_RAINSTORM: {{ .Values.testy.daybedRainstorm | quote }}
  FEE: {{ .Values.testy.fee | quote }}
  LOQUAT_BED: {{ .Values.testy.loquatBed | quote }}
  VICTIM_GO_FORTE: {{ .Values.testy.victimGoForte | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "testy.fullname" . }}-testy
  labels:
  {{- include "testy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: testy
spec:
  replicas: {{ .Values.testy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: testy
      app.kubernetes.io/name: president
    {{- include "testy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: testy
        app.kubernetes.io/name: president
      {{- include "testy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a7b842fb582de1188fff8c9252d69dab5f62a38d09bf9b7e6aca5261eddc8f02
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "testy.fullname" . }}-testy
        image: {{ .Values.testy.testy.image.repository }}:{{ .Values.testy.testy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.testy.testy.imagePullPolicy }}
        name: testy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.testy.testy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.testy.testy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "testy.fullname" . }}-testy
  labels:
  {{- include "testy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.testy.type }}
  selector:
    app.kubernetes.io/instance: testy
    app.kubernetes.io/name: president
  {{- include "testy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.testy.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
testy:
  daybedRainstorm: nut
  fee: cupcake
  loquatBed: octagon
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  testy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  victimGoForte: watchmaker
