# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "destroyer.fullname" . }}-destroyer
  labels:
  {{- include "destroyer.labels" . | nindent 4 }}
data:
  DEFEATED: {{ .Values.destroyer.defeated | quote }}
  DRIP_FRIES_PARENTING: {{ .Values.destroyer.dripFriesParenting | quote }}
  FOURTHS_LITMUS: {{ .Values.destroyer.fourthsLitmus | quote }}
  JICAMA_BUFFET_ROUNDABOUT: {{ .Values.destroyer.jicamaBuffetRoundabout | quote }}
  KILL_FUSARIUM: {{ .Values.destroyer.killFusarium | quote }}
  MUDDY: {{ .Values.destroyer.muddy | quote }}
  NOTEBOOK_LINK_LOOKOUT: {{ .Values.destroyer.notebookLinkLookout | quote }}
  SYSTEM_CHAIR_TORTE: {{ .Values.destroyer.systemChairTorte | quote }}
  WEIRD_DEVIATION: {{ .Values.destroyer.weirdDeviation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "destroyer.fullname" . }}-destroyer
  labels:
  {{- include "destroyer.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: destroyer
spec:
  replicas: {{ .Values.destroyer.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: destroyer
      app.kubernetes.io/name: cope
    {{- include "destroyer.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: destroyer
        app.kubernetes.io/name: cope
      {{- include "destroyer.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 05c73d2072c316f7b57fe1d7cb7c3efd06aa550bfd36b69253bda32c6055cd27
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "destroyer.fullname" . }}-destroyer
        image: {{ .Values.destroyer.destroyer.image.repository }}:{{ .Values.destroyer.destroyer.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.destroyer.destroyer.imagePullPolicy }}
        name: destroyer
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.destroyer.destroyer.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.destroyer.destroyer.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "destroyer.fullname" . }}-destroyer
  labels:
  {{- include "destroyer.labels" . | nindent 4 }}
spec:
  type: {{ .Values.destroyer.type }}
  selector:
    app.kubernetes.io/instance: destroyer
    app.kubernetes.io/name: cope
  {{- include "destroyer.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.destroyer.ports | toYaml | nindent 2 -}}
destroyer:
  defeated: period
  destroyer:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dripFriesParenting: reserve
  fourthsLitmus: cobweb
  jicamaBuffetRoundabout: timpani
  killFusarium: deficit
  muddy: sincere
  notebookLinkLookout: pole
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  systemChairTorte: exclusive
  type: ClusterIP
  weirdDeviation: ex-wife
kubernetesClusterDomain: cluster.local
