Skip to content

Add kubernetes Python library to sonic-mgmt container#25564

Merged
yxieca merged 1 commit intosonic-net:masterfrom
hdwhdw:feature/kubesonic-test-support
Feb 25, 2026
Merged

Add kubernetes Python library to sonic-mgmt container#25564
yxieca merged 1 commit intosonic-net:masterfrom
hdwhdw:feature/kubesonic-test-support

Conversation

@hdwhdw
Copy link
Copy Markdown
Contributor

@hdwhdw hdwhdw commented Feb 18, 2026

Add kubernetes Python package to docker-sonic-mgmt for kubesonic test automation support.

The Python library provides K8s API access for tests that verify SONiC's Kubernetes integration (kubesonic).

Note: kubectl binary is not needed - tests use:

  • Python kubernetes library for API operations
  • minikube kubectl on vmhost for cluster management

Why I did it

Enable kubesonic integration tests in sonic-mgmt. The tests use Python kubernetes client to interact with the K8s cluster API.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Added kubernetes to the pip install list in docker-sonic-mgmt Dockerfile.

How to verify it

Build sonic-mgmt container and verify kubernetes package is installed:

python -c "import kubernetes; print(kubernetes.__version__)"

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

  • [ ]
  • [ ]

Description for the changelog

Add kubernetes Python library to sonic-mgmt container for kubesonic test support.

Link to config_db schema for YANG module changes

N/A

A picture of a cute animal (not mandatory but encouraged)

Copilot AI review requested due to automatic review settings February 18, 2026 22:12
@hdwhdw hdwhdw requested a review from lguohan as a code owner February 18, 2026 22:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Kubernetes tooling into the docker-sonic-mgmt container image to support kubesonic test automation workflows.

Changes:

  • Add the kubernetes Python client library to the container’s pip-installed dependencies.
  • Download and install a kubectl binary into /usr/local/bin.

Add kubernetes Python package to docker-sonic-mgmt for kubesonic test
automation support. The Python library provides K8s API access for tests.

Note: kubectl binary is not needed - tests use:
- Python kubernetes library for API operations
- minikube kubectl on vmhost for cluster management

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@hdwhdw hdwhdw changed the title Add kubernetes dependencies to sonic-mgmt container Add kubernetes Python library to sonic-mgmt container Feb 19, 2026
@hdwhdw hdwhdw force-pushed the feature/kubesonic-test-support branch from 0b2f486 to 547a8f9 Compare February 19, 2026 16:31
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: simple dependency add; looks good.

@yxieca yxieca merged commit 9aba59d into sonic-net:master Feb 25, 2026
31 of 32 checks passed
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
What is the motivation for this PR
Enable kubesonic integration tests in sonic-mgmt; tests use the Python kubernetes client to interact with the K8s API.

How did you do it
Added kubernetes to the pip install list in the docker-sonic-mgmt Dockerfile.

How did you verify/test it
Build sonic-mgmt container and verify kubernetes package is installed:
python -c "import kubernetes; print(kubernetes.__version__)"

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: Feng Pan <fenpan@microsoft.com>
dprital pushed a commit that referenced this pull request Mar 19, 2026
What is the motivation for this PR
Enable kubesonic integration tests in sonic-mgmt; tests use the Python kubernetes client to interact with the K8s API.

How did you do it
Added kubernetes to the pip install list in the docker-sonic-mgmt Dockerfile.

How did you verify/test it
Build sonic-mgmt container and verify kubernetes package is installed:
python -c "import kubernetes; print(kubernetes.__version__)"

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: dprital <drorp@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants