# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "fighter.fullname" . }}-fighter
  labels:
  {{- include "fighter.labels" . | nindent 4 }}
data:
  ASSESS_CONSUMER_YOKE: {{ .Values.fighter.assessConsumerYoke | quote }}
  FORECAST: {{ .Values.fighter.forecast | quote }}
  FORMAT_REGISTER_NECKTIE: {{ .Values.fighter.formatRegisterNecktie | quote }}
  HOBBY: {{ .Values.fighter.hobby | quote }}
  INFARCTION_ANGEL: {{ .Values.fighter.infarctionAngel | quote }}
  MOONSCAPE: {{ .Values.fighter.moonscape | quote }}
  NIFTY: {{ .Values.fighter.nifty | quote }}
  OVERSIGHT_BELT: {{ .Values.fighter.oversightBelt | quote }}
  PARCHED: {{ .Values.fighter.parched | quote }}
  REGULATE_CURIO: {{ .Values.fighter.regulateCurio | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "fighter.fullname" . }}-fighter
  labels:
  {{- include "fighter.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: fighter
spec:
  replicas: {{ .Values.fighter.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: fighter
      app.kubernetes.io/name: terrify
    {{- include "fighter.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: fighter
        app.kubernetes.io/name: terrify
      {{- include "fighter.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: de65ace21560dcf87794ec7ec146649f28040ceb9da81041513750e9ef6d4a12
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "fighter.fullname" . }}-fighter
        image: {{ .Values.fighter.fighter.image.repository }}:{{ .Values.fighter.fighter.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.fighter.fighter.imagePullPolicy }}
        name: fighter
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.fighter.fighter.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.fighter.fighter.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "fighter.fullname" . }}-fighter
  labels:
  {{- include "fighter.labels" . | nindent 4 }}
spec:
  type: {{ .Values.fighter.type }}
  selector:
    app.kubernetes.io/instance: fighter
    app.kubernetes.io/name: terrify
  {{- include "fighter.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.fighter.ports | toYaml | nindent 2 -}}
fighter:
  assessConsumerYoke: rite
  fighter:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  forecast: dissonance
  formatRegisterNecktie: tiara
  hobby: tiger
  infarctionAngel: sesame
  moonscape: demand
  nifty: hit
  oversightBelt: abortive
  parched: cravat
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  regulateCurio: slit
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
