ConfigMap with FilesΒΆ

This example shows how a ConfigMap can be populated from files on disk using Python to do the heavy lifting instead of having to store the file data inside a ConfigMap resource configuration file.

from kuber.latest import core_v1

config_map = core_v1.ConfigMap()

# Populate the metadata on the ConfigMap.
with config_map.metadata as md: = "glossary"
    md.namespace = "reference"
    md.labels.update(topic="kubernetes", version="1.0")

# Load file from disk and add it to the ConfigMap's data
# object with the key `data.json`.
with open("./data.json") as f:["data.json"] =

# Display results.

Complete code for this example is available at: kuber/examples/config-map/