# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "obligation.fullname" . }}-obligation
  labels:
  {{- include "obligation.labels" . | nindent 4 }}
data:
  BASICS_DEDUCTION_SKULL: {{ .Values.obligation.basicsDeductionSkull | quote }}
  BUDDY_RIGHTEOUS: {{ .Values.obligation.buddyRighteous | quote }}
  CHICK: {{ .Values.obligation.chick | quote }}
  COMPOSITE: {{ .Values.obligation.composite | quote }}
  GREENS_CUCUMBER: {{ .Values.obligation.greensCucumber | quote }}
  PROBATION_OFFEND_PICNIC: {{ .Values.obligation.probationOffendPicnic | quote }}
  SPECTACLE: {{ .Values.obligation.spectacle | quote }}
  VIBE: {{ .Values.obligation.vibe | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "obligation.fullname" . }}-obligation
  labels:
  {{- include "obligation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: obligation
spec:
  replicas: {{ .Values.obligation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: obligation
      app.kubernetes.io/name: telling
    {{- include "obligation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: obligation
        app.kubernetes.io/name: telling
      {{- include "obligation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 54ad1764e2e54c2180c957adeec9eb11da308e3e391d9cff37197e6c8942cd5c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "obligation.fullname" . }}-obligation
        image: {{ .Values.obligation.obligation.image.repository }}:{{ .Values.obligation.obligation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.obligation.obligation.imagePullPolicy }}
        name: obligation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.obligation.obligation.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.obligation.obligation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "obligation.fullname" . }}-obligation
  labels:
  {{- include "obligation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.obligation.type }}
  selector:
    app.kubernetes.io/instance: obligation
    app.kubernetes.io/name: telling
  {{- include "obligation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.obligation.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
obligation:
  basicsDeductionSkull: unable
  buddyRighteous: wiseguy
  chick: beast
  composite: terrorism
  greensCucumber: daddy
  obligation:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  probationOffendPicnic: measurement
  replicas: 1
  spectacle: ritual
  type: ClusterIP
  vibe: android
