Skip to content

Create ConfigMaps | kustomization.yaml

Create configmaps using kustomize and local files

YAML
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: web-configmap
  files:
  - device.conf
  - new.txt
  - index.html
  - file-xxx

In case there is a big file you can use

Bash
kubectl apply --server-side=true -k .

Add values directly

YAML
configMapGenerator:
- name: my-configmap
  literals:
  - foo=bar
  - baz=qux