# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bite.fullname" . }}-bite
  labels:
  {{- include "bite.labels" . | nindent 4 }}
data:
  FOOTREST_MINORITY: {{ .Values.bite.footrestMinority | quote }}
  RITUAL_DEAFENING_FORAGER: {{ .Values.bite.ritualDeafeningForager | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bite.fullname" . }}-bite
  labels:
  {{- include "bite.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bite
spec:
  replicas: {{ .Values.bite.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bite
      app.kubernetes.io/name: collagen
    {{- include "bite.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bite
        app.kubernetes.io/name: collagen
      {{- include "bite.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 962babca0bbfdb09ec00d8ad4e30cd57ee92b4a0e46b549ffe8c29165d47f9ee
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bite.fullname" . }}-bite
        image: {{ .Values.bite.bite.image.repository }}:{{ .Values.bite.bite.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bite.bite.imagePullPolicy }}
        name: bite
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bite.bite.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bite.bite.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bite.fullname" . }}-bite
  labels:
  {{- include "bite.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bite.type }}
  selector:
    app.kubernetes.io/instance: bite
    app.kubernetes.io/name: collagen
  {{- include "bite.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bite.ports | toYaml | nindent 2 -}}
bite:
  bite:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  footrestMinority: tradition
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  ritualDeafeningForager: danger
  type: ClusterIP
kubernetesClusterDomain: cluster.local
