Is there a library to use kubernetes configmap as key-value store for persistence?

Viewed 95

I am looking for a Python library to use Kubernetes directly as key-value store. I am thinking of sth. as follows:

# initialize a configmap
store = python_keyvalue.init_cm("configmap-name")

# set the value
store.set(key="username",value="blubblub")

# retrieve the value
my_username = store.get(key="username")

The produced configmap may look as follows:

apiVersion: v1
data:
  username: blubblub
kind: ConfigMap
metadata:
  name: configmap-name

It seems like a comfortable way to store some values without much overhead.

Of course Python k8s api is not that complicated, but still things can get complicated quite fast... Also spinning up a Redis or using sqllite is an option, but for storing one or two simple values this is quite a huge overhead.

Haven't found anything and googling is quite complicated :).

0 Answers
Related