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