# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "devastation.fullname" . }}-devastation
  labels:
  {{- include "devastation.labels" . | nindent 4 }}
data:
  BALLOT_DIRNDL_JOINT: {{ .Values.devastation.ballotDirndlJoint | quote }}
  CHICKEN: {{ .Values.devastation.chicken | quote }}
  FROG_NET: {{ .Values.devastation.frogNet | quote }}
  JADED_THRUST_SLEEPY: {{ .Values.devastation.jadedThrustSleepy | quote }}
  MEMBER_CURLY: {{ .Values.devastation.memberCurly | quote }}
  MOOR_TRITE: {{ .Values.devastation.moorTrite | quote }}
  PANTHER_EXPERIMENTATION: {{ .Values.devastation.pantherExperimentation | quote
    }}
  WATERFALL_IRRIGATION_SLOW: {{ .Values.devastation.waterfallIrrigationSlow | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "devastation.fullname" . }}-devastation
  labels:
  {{- include "devastation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: devastation
spec:
  replicas: {{ .Values.devastation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: devastation
      app.kubernetes.io/name: learning
    {{- include "devastation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: devastation
        app.kubernetes.io/name: learning
      {{- include "devastation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f7a355caefe70c5b1f490a9804b9f82ad31f43f5197d1823dd95f8ec1ea5fee2
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "devastation.fullname" . }}-devastation
        image: {{ .Values.devastation.devastation.image.repository }}:{{ .Values.devastation.devastation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.devastation.devastation.imagePullPolicy }}
        name: devastation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.devastation.devastation.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.devastation.devastation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "devastation.fullname" . }}-devastation
  labels:
  {{- include "devastation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.devastation.type }}
  selector:
    app.kubernetes.io/instance: devastation
    app.kubernetes.io/name: learning
  {{- include "devastation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.devastation.ports | toYaml | nindent 2 -}}
devastation:
  ballotDirndlJoint: butcher
  chicken: collagen
  devastation:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  frogNet: furnace
  jadedThrustSleepy: minor-league
  memberCurly: clothing
  moorTrite: quotation
  pantherExperimentation: transfer
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  waterfallIrrigationSlow: sweatshirt
kubernetesClusterDomain: cluster.local
