# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "warlord.fullname" . }}-warlord
  labels:
  {{- include "warlord.labels" . | nindent 4 }}
data:
  ANGSTROM_NOTEBOOK: {{ .Values.warlord.angstromNotebook | quote }}
  BANKBOOK: {{ .Values.warlord.bankbook | quote }}
  DECORATION: {{ .Values.warlord.decoration | quote }}
  DESKTOP: {{ .Values.warlord.desktop | quote }}
  DOOR_CYCLONE_AGLET: {{ .Values.warlord.doorCycloneAglet | quote }}
  DUMP_OVERHEAD_SETTLER: {{ .Values.warlord.dumpOverheadSettler | quote }}
  JAGUAR_LEARNING_SEPARATION: {{ .Values.warlord.jaguarLearningSeparation | quote
    }}
  PATE_APPLAUD: {{ .Values.warlord.pateApplaud | quote }}
  SCANNER_MINE_KEYBOARD: {{ .Values.warlord.scannerMineKeyboard | quote }}
  SPUD: {{ .Values.warlord.spud | quote }}
  STRIDE_BAKERY_EXPRESSION: {{ .Values.warlord.strideBakeryExpression | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "warlord.fullname" . }}-warlord
  labels:
  {{- include "warlord.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: warlord
spec:
  replicas: {{ .Values.warlord.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: warlord
      app.kubernetes.io/name: muskrat
    {{- include "warlord.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: warlord
        app.kubernetes.io/name: muskrat
      {{- include "warlord.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b077617e3e71ffbd1ac75c04bb8d9f3b0991dcf1741191b9b7901b6183d7cc5a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "warlord.fullname" . }}-warlord
        image: {{ .Values.warlord.warlord.image.repository }}:{{ .Values.warlord.warlord.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.warlord.warlord.imagePullPolicy }}
        name: warlord
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.warlord.warlord.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.warlord.warlord.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "warlord.fullname" . }}-warlord
  labels:
  {{- include "warlord.labels" . | nindent 4 }}
spec:
  type: {{ .Values.warlord.type }}
  selector:
    app.kubernetes.io/instance: warlord
    app.kubernetes.io/name: muskrat
  {{- include "warlord.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.warlord.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
warlord:
  angstromNotebook: backbone
  bankbook: microphone
  decoration: subject
  desktop: antennae
  doorCycloneAglet: adverb
  dumpOverheadSettler: adjective
  jaguarLearningSeparation: joy
  pateApplaud: insomnia
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scannerMineKeyboard: scintillating
  spud: irrigation
  strideBakeryExpression: sedate
  type: ClusterIP
  warlord:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
