# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "wooden.fullname" . }}-wooden
  labels:
  {{- include "wooden.labels" . | nindent 4 }}
data:
  INQUIRY_CLAN: {{ .Values.wooden.inquiryClan | quote }}
  PERPETUAL_BAOBAB_TAKE-OUT: {{ .Values.wooden.perpetualBaobabTakeOut | quote }}
  WIDGET: {{ .Values.wooden.widget | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "wooden.fullname" . }}-wooden
  labels:
  {{- include "wooden.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: wooden
spec:
  replicas: {{ .Values.wooden.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: wooden
      app.kubernetes.io/name: yacht
    {{- include "wooden.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: wooden
        app.kubernetes.io/name: yacht
      {{- include "wooden.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: acb988fb391e87968eaa506834de56affa8c710f1cee0337fc4c18a69590abce
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "wooden.fullname" . }}-wooden
        image: {{ .Values.wooden.wooden.image.repository }}:{{ .Values.wooden.wooden.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.wooden.wooden.imagePullPolicy }}
        name: wooden
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.wooden.wooden.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.wooden.wooden.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "wooden.fullname" . }}-wooden
  labels:
  {{- include "wooden.labels" . | nindent 4 }}
spec:
  type: {{ .Values.wooden.type }}
  selector:
    app.kubernetes.io/instance: wooden
    app.kubernetes.io/name: yacht
  {{- include "wooden.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.wooden.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
wooden:
  inquiryClan: veldt
  perpetualBaobabTakeOut: robust
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  widget: runaway
  wooden:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
