# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bug.fullname" . }}-bug
  labels:
  {{- include "bug.labels" . | nindent 4 }}
data:
  EDGE_FOLLOW_PRAY: {{ .Values.bug.edgeFollowPray | quote }}
  FLIGHT_MANTLE_ANIMAL: {{ .Values.bug.flightMantleAnimal | quote }}
  FLUNG: {{ .Values.bug.flung | quote }}
  INITIALISE_CONTEST: {{ .Values.bug.initialiseContest | quote }}
  KIDNEY: {{ .Values.bug.kidney | quote }}
  REFLECTIVE_INTERVAL_JODHPURS: {{ .Values.bug.reflectiveIntervalJodhpurs | quote
    }}
  RETROSPECT: {{ .Values.bug.retrospect | quote }}
  WAFFLE_RANGER_DAM: {{ .Values.bug.waffleRangerDam | quote }}
  WAGE_ASHRAM_ASSOCIATE: {{ .Values.bug.wageAshramAssociate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bug.fullname" . }}-bug
  labels:
  {{- include "bug.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bug
spec:
  replicas: {{ .Values.bug.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bug
      app.kubernetes.io/name: speculation
    {{- include "bug.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bug
        app.kubernetes.io/name: speculation
      {{- include "bug.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9c0b3535f57aac1b9efda8b55a0d6cfb33bbac84d95443ae08ff0500f4375d88
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bug.fullname" . }}-bug
        image: {{ .Values.bug.bug.image.repository }}:{{ .Values.bug.bug.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bug.bug.imagePullPolicy }}
        name: bug
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bug.bug.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bug.bug.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bug.fullname" . }}-bug
  labels:
  {{- include "bug.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bug.type }}
  selector:
    app.kubernetes.io/instance: bug
    app.kubernetes.io/name: speculation
  {{- include "bug.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bug.ports | toYaml | nindent 2 -}}
bug:
  bug:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  edgeFollowPray: food
  flightMantleAnimal: hook
  flung: swine
  initialiseContest: marry
  kidney: offer
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reflectiveIntervalJodhpurs: cirrus
  replicas: 1
  retrospect: duration
  type: ClusterIP
  waffleRangerDam: subsidy
  wageAshramAssociate: archeology
kubernetesClusterDomain: cluster.local
