# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bother.fullname" . }}-bother
  labels:
  {{- include "bother.labels" . | nindent 4 }}
data:
  ATTACKER: {{ .Values.bother.attacker | quote }}
  CHANGE_TEAPOT_FAITHFUL: {{ .Values.bother.changeTeapotFaithful | quote }}
  FIGHT: {{ .Values.bother.fight | quote }}
  FORMULA_ORIGIN_MOLE: {{ .Values.bother.formulaOriginMole | quote }}
  GRANDSON_TRAIN: {{ .Values.bother.grandsonTrain | quote }}
  HIKE: {{ .Values.bother.hike | quote }}
  TINDERBOX_VICTORIOUS: {{ .Values.bother.tinderboxVictorious | quote }}
  VENGEFUL_BOG: {{ .Values.bother.vengefulBog | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bother.fullname" . }}-bother
  labels:
  {{- include "bother.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bother
spec:
  replicas: {{ .Values.bother.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bother
      app.kubernetes.io/name: forgetful
    {{- include "bother.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bother
        app.kubernetes.io/name: forgetful
      {{- include "bother.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 06bf5024caac60b8b4f8daf71d86fcc9ff5e7f51bc2b854babe59f98a67f9a6b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bother.fullname" . }}-bother
        image: {{ .Values.bother.bother.image.repository }}:{{ .Values.bother.bother.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bother.bother.imagePullPolicy }}
        name: bother
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bother.bother.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bother.bother.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bother.fullname" . }}-bother
  labels:
  {{- include "bother.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bother.type }}
  selector:
    app.kubernetes.io/instance: bother
    app.kubernetes.io/name: forgetful
  {{- include "bother.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bother.ports | toYaml | nindent 2 -}}
bother:
  attacker: guarantee
  bother:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  changeTeapotFaithful: still
  fight: estrogen
  formulaOriginMole: screw-up
  grandsonTrain: teletype
  hike: lye
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tinderboxVictorious: ex-husband
  type: ClusterIP
  vengefulBog: tranquil
kubernetesClusterDomain: cluster.local
