# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "injury.fullname" . }}-injury
  labels:
  {{- include "injury.labels" . | nindent 4 }}
data:
  BELLIGERENT: {{ .Values.injury.belligerent | quote }}
  DESTINATION_WORSHIPER: {{ .Values.injury.destinationWorshiper | quote }}
  LECTURE: {{ .Values.injury.lecture | quote }}
  TUTOR: {{ .Values.injury.tutor | quote }}
  WEALTHY_OPPORTUNITY: {{ .Values.injury.wealthyOpportunity | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "injury.fullname" . }}-injury
  labels:
  {{- include "injury.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: injury
spec:
  replicas: {{ .Values.injury.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: injury
      app.kubernetes.io/name: saucer
    {{- include "injury.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: injury
        app.kubernetes.io/name: saucer
      {{- include "injury.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 39a5bc8207cf995ea1925df94183f4ba2ae3415ccf6fcf10f5c549a41531a36b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "injury.fullname" . }}-injury
        image: {{ .Values.injury.injury.image.repository }}:{{ .Values.injury.injury.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.injury.injury.imagePullPolicy }}
        name: injury
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.injury.injury.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.injury.injury.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "injury.fullname" . }}-injury
  labels:
  {{- include "injury.labels" . | nindent 4 }}
spec:
  type: {{ .Values.injury.type }}
  selector:
    app.kubernetes.io/instance: injury
    app.kubernetes.io/name: saucer
  {{- include "injury.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.injury.ports | toYaml | nindent 2 -}}
injury:
  belligerent: collaboration
  destinationWorshiper: first
  injury:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  lecture: walrus
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tutor: tattler
  type: ClusterIP
  wealthyOpportunity: understood
kubernetesClusterDomain: cluster.local
