# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "withdrawal.fullname" . }}-withdrawal
  labels:
  {{- include "withdrawal.labels" . | nindent 4 }}
data:
  CANDELABRA_PODCAST: {{ .Values.withdrawal.candelabraPodcast | quote }}
  FRAME: {{ .Values.withdrawal.frame | quote }}
  LUNG: {{ .Values.withdrawal.lung | quote }}
  OBOE_SENATE_BEEF: {{ .Values.withdrawal.oboeSenateBeef | quote }}
  SECRETIVE_GROWTH_EVANESCENT: {{ .Values.withdrawal.secretiveGrowthEvanescent |
    quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "withdrawal.fullname" . }}-withdrawal
  labels:
  {{- include "withdrawal.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: withdrawal
spec:
  replicas: {{ .Values.withdrawal.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: withdrawal
      app.kubernetes.io/name: trot
    {{- include "withdrawal.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: withdrawal
        app.kubernetes.io/name: trot
      {{- include "withdrawal.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9c0d1b59801084c8a65656db1ca8d2ee308d740cf32c31011d533dc6fa7a9d84
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "withdrawal.fullname" . }}-withdrawal
        image: {{ .Values.withdrawal.withdrawal.image.repository }}:{{ .Values.withdrawal.withdrawal.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.withdrawal.withdrawal.imagePullPolicy }}
        name: withdrawal
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.withdrawal.withdrawal.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.withdrawal.withdrawal.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "withdrawal.fullname" . }}-withdrawal
  labels:
  {{- include "withdrawal.labels" . | nindent 4 }}
spec:
  type: {{ .Values.withdrawal.type }}
  selector:
    app.kubernetes.io/instance: withdrawal
    app.kubernetes.io/name: trot
  {{- include "withdrawal.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.withdrawal.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
withdrawal:
  candelabraPodcast: twister
  frame: oyster
  lung: CD
  oboeSenateBeef: former
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  secretiveGrowthEvanescent: synonym
  type: ClusterIP
  withdrawal:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
