# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dynamics.fullname" . }}-dynamics
  labels:
  {{- include "dynamics.labels" . | nindent 4 }}
data:
  APARTMENT: {{ .Values.dynamics.apartment | quote }}
  BIND_REPRODUCE_DEMOCRACY: {{ .Values.dynamics.bindReproduceDemocracy | quote }}
  DEBONAIR_ENSURE_ALIGHT: {{ .Values.dynamics.debonairEnsureAlight | quote }}
  DILL_APERITIF: {{ .Values.dynamics.dillAperitif | quote }}
  DUGOUT: {{ .Values.dynamics.dugout | quote }}
  LYOCELL: {{ .Values.dynamics.lyocell | quote }}
  TEAMMATE_LOOP: {{ .Values.dynamics.teammateLoop | quote }}
  UPSET: {{ .Values.dynamics.upset | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dynamics.fullname" . }}-dynamics
  labels:
  {{- include "dynamics.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dynamics
spec:
  replicas: {{ .Values.dynamics.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dynamics
      app.kubernetes.io/name: tabletop
    {{- include "dynamics.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dynamics
        app.kubernetes.io/name: tabletop
      {{- include "dynamics.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ee1eff949d72d387ae02b8e988a619e4d78f995b26469f0ee764296ab5188f46
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dynamics.fullname" . }}-dynamics
        image: {{ .Values.dynamics.dynamics.image.repository }}:{{ .Values.dynamics.dynamics.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dynamics.dynamics.imagePullPolicy }}
        name: dynamics
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dynamics.dynamics.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dynamics.dynamics.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dynamics.fullname" . }}-dynamics
  labels:
  {{- include "dynamics.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dynamics.type }}
  selector:
    app.kubernetes.io/instance: dynamics
    app.kubernetes.io/name: tabletop
  {{- include "dynamics.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dynamics.ports | toYaml | nindent 2 -}}
dynamics:
  apartment: washtub
  bindReproduceDemocracy: burro
  debonairEnsureAlight: equinox
  dillAperitif: vet
  dugout: cantaloupe
  dynamics:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  lyocell: chairman
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  teammateLoop: ascertain
  type: ClusterIP
  upset: standard
kubernetesClusterDomain: cluster.local
