# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dedication.fullname" . }}-dedication
  labels:
  {{- include "dedication.labels" . | nindent 4 }}
data:
  AMAZON: {{ .Values.dedication.amazon | quote }}
  CURLER_ALMANAC_PEACOCK: {{ .Values.dedication.curlerAlmanacPeacock | quote }}
  FLOW_WEARY: {{ .Values.dedication.flowWeary | quote }}
  GLASSES_EXPERT_GOVERNANCE: {{ .Values.dedication.glassesExpertGovernance | quote
    }}
  KNIGHT_ABORTION_TRAILER: {{ .Values.dedication.knightAbortionTrailer | quote }}
  KNOW-HOW_APPETIZER: {{ .Values.dedication.knowHowAppetizer | quote }}
  LIME: {{ .Values.dedication.lime | quote }}
  SHRINK: {{ .Values.dedication.shrink | quote }}
  THERMALS: {{ .Values.dedication.thermals | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dedication.fullname" . }}-dedication
  labels:
  {{- include "dedication.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dedication
spec:
  replicas: {{ .Values.dedication.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dedication
      app.kubernetes.io/name: system
    {{- include "dedication.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dedication
        app.kubernetes.io/name: system
      {{- include "dedication.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: bb2273e42bb3e6b7d9abe5adc61e2a96fa73086101cd5adf7827efd2a0c4ab57
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dedication.fullname" . }}-dedication
        image: {{ .Values.dedication.dedication.image.repository }}:{{ .Values.dedication.dedication.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dedication.dedication.imagePullPolicy }}
        name: dedication
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dedication.dedication.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dedication.dedication.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dedication.fullname" . }}-dedication
  labels:
  {{- include "dedication.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dedication.type }}
  selector:
    app.kubernetes.io/instance: dedication
    app.kubernetes.io/name: system
  {{- include "dedication.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dedication.ports | toYaml | nindent 2 -}}
dedication:
  amazon: forum
  curlerAlmanacPeacock: adult
  dedication:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  flowWeary: whack
  glassesExpertGovernance: share
  knightAbortionTrailer: season
  knowHowAppetizer: farmland
  lime: iceberg
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shrink: wrecker
  thermals: join
  type: ClusterIP
kubernetesClusterDomain: cluster.local
