# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "danger.fullname" . }}-danger
  labels:
  {{- include "danger.labels" . | nindent 4 }}
data:
  AUTOMATON_FISH: {{ .Values.danger.automatonFish | quote }}
  BALACLAVA: {{ .Values.danger.balaclava | quote }}
  BASIS_CHIVALRY: {{ .Values.danger.basisChivalry | quote }}
  DISPOSER_ASTRAKHAN_ANTIQUE: {{ .Values.danger.disposerAstrakhanAntique | quote
    }}
  DRAKE_INDUCE: {{ .Values.danger.drakeInduce | quote }}
  ELONGATION: {{ .Values.danger.elongation | quote }}
  OMEGA_HEYDAY_DYSFUNCTIONAL: {{ .Values.danger.omegaHeydayDysfunctional | quote
    }}
  PUMA_ICKY_NICK: {{ .Values.danger.pumaIckyNick | quote }}
  TOLL_CHRYSALIS_VARIOUS: {{ .Values.danger.tollChrysalisVarious | quote }}
  WIDE-EYED: {{ .Values.danger.wideEyed | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "danger.fullname" . }}-danger
  labels:
  {{- include "danger.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: danger
spec:
  replicas: {{ .Values.danger.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: danger
      app.kubernetes.io/name: dependent
    {{- include "danger.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: danger
        app.kubernetes.io/name: dependent
      {{- include "danger.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 21c3b6736bcb8e7b5db1c5fbf3ae505bd7807ccbd45c3ec59a5f0494f6c28277
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "danger.fullname" . }}-danger
        image: {{ .Values.danger.danger.image.repository }}:{{ .Values.danger.danger.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.danger.danger.imagePullPolicy }}
        name: danger
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.danger.danger.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.danger.danger.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "danger.fullname" . }}-danger
  labels:
  {{- include "danger.labels" . | nindent 4 }}
spec:
  type: {{ .Values.danger.type }}
  selector:
    app.kubernetes.io/instance: danger
    app.kubernetes.io/name: dependent
  {{- include "danger.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.danger.ports | toYaml | nindent 2 -}}
danger:
  automatonFish: integration
  balaclava: poster
  basisChivalry: easy
  danger:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  disposerAstrakhanAntique: math
  drakeInduce: recipient
  elongation: tam-o'-shanter
  omegaHeydayDysfunctional: tube
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pumaIckyNick: jam
  replicas: 1
  tollChrysalisVarious: hotdog
  type: ClusterIP
  wideEyed: terrapin
kubernetesClusterDomain: cluster.local
