module
Version:
v0.0.0-...-d0afb55
Opens a new window with list of versions in this module.
Published: Oct 11, 2023
License: MIT
Opens a new window with license information.
README
¶
MegaConfigMap
As you may already know, ConfigMap has 1MB size limit.
However we often create configuration files larger than 1MB 👼
megaconfigmap enables you to manage ConfigMap larger than 1MB.
This system consists of two components:
kubectl-megaconfigmap
- kubectl plugin to create a large configmap.
combiner
- One-shot program to combine partial configmaps to large one. It is designed to run on init-container.
Quick start
- Install kubectl-megaconfigmap.
$ git clone [email protected]:dulltz/megaconfigmap.git
$ cd megaconfigmap
$ go install -mod=vendor ./cmd/kubectl-megaconfigmap/
- Prepare a large file.
$ dd if=/dev/zero of=examples/2MB.dummy count=2 bs=1m
- Create a megaconfigmap.
$ kubectl megaconfigmap create my-conf --from-file examples/2MB.dummy
- Apply the example manifest.
$ kubectl apply -f examples/pod.yaml
- Login to the pod, then you can see the 2MB.dummy.
$ kubectl exec -it megaconfigmap-demo -- ls -lh /demo
- Cleanup the resources.
$ kubectl delete -f examples/pod.yaml
$ kubectl delete configmap my-conf
How it works
- Create megaconfigmap and partial-configmaps by
kubectl megaconfigmap create
.
- Combiner init-container collect partial-item from megaconfigmap specified at
--megaconfigmap
flag.
- Combiner dump the file to the path on the share volume specified at
--share-dir
flag.
- If you mount the share volume to the main container, you can get the large file there.
Glossary
- megaconfigmap
- The owner of partial-configmaps
- It is not mounted
- It has only metadata.
- It has the following labels:
megaconfigmap.io/id
: hash string of the config file
megaconfigmap.io/filename
: output file name
megaconfigmap.io/master
: indicate that this resource is a megaconfigmap
- partial-configmaps
- The children of the megaconfigmap. If you delete megaconfigmap, its children are also deleted.
- These configmaps contain the partial data of source file.
- The file content is split into multiple configmaps to hold large file.
- They have the following labels:
megaconfigmap.io/id
: hash string of the config file
megaconfigmap.io/filename
: output file name
megaconfigmap.io/order
: the ordering number of the configmap
Caution
Do not create too large megaconfigmap because Etcd can store only 2-3GB.
Click to show internal directories.
Click to hide internal directories.