Skip to content

examples: add config_map example for CoreV1Api and Pod mounting - #2816

Open
anisayakmitra-in wants to merge 1 commit into
kubernetes-client:masterfrom
anisayakmitra-in:example-configmap-usage
Open

anisayakmitra-in wants to merge 1 commit into
kubernetes-client:masterfrom
anisayakmitra-in:example-configmap-usage

Conversation

@anisayakmitra-in

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind documentation

What this PR does / why we need it:

Adds examples/config_map.py demonstrating how to create a V1ConfigMap and consume its data in a V1Pod using typed CoreV1Api models.

The example covers:

  • Creating a client.V1ConfigMap containing property-like key-value pairs and multi-line file configurations.
  • Consuming ConfigMap data as environment variables using client.V1EnvFromSource and client.V1ConfigMapEnvSource.
  • Mounting the ConfigMap into the container filesystem via client.V1Volume (client.V1ConfigMapVolumeSource) and client.V1VolumeMount.
  • Creating and monitoring the Pod (v1.create_namespaced_pod).
  • Cleaning up resources upon completion.
  • Indexing config_map.py in examples/README.md.

Which issue(s) this PR fixes:

Fixes #2263

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None

Signed-off-by: ANISAYAK MITRA <266799942+anisayakmitra-in@users.noreply.github.com>
@kubernetes-prow kubernetes-prow Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Nov 28, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anisayakmitra-in
Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the kind/documentation Categorizes issue or PR as related to documentation. label Nov 28, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog November 28, 2026 04:50
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear Usage of V1ConfigMap

1 participant