Skip to content

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

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-client:masterfrom
anisayakmitra-in:example-configmap-usage
Nov 28, 2026
Merged

kubernetes-prow[bot] merged 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 release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. labels 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
@yliaog

yliaog commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 28, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anisayakmitra-in, yliaog

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit c2aaa86 into kubernetes-client:master Nov 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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

2 participants