Skip to content

Library to generate Kubernetes manifests using Python code

License

Notifications You must be signed in to change notification settings

joaompinto/kubekind

Repository files navigation

kubekind

Library to generate Kubernetes manifests using Python code

PyPi Code style: black

Motivation

Write manifests using Python code to improve readability and getting the benefits of IDEs IntelliSense features.

Requirements

  • Python 3.9+ on Linux, Windows or Mac

Install

pip insall kubekind

Generated a pod manifest

# test.py
from kubekind import Pod, Container

with Pod("my-pod") as pod:
    Container("bash", "bash:latest", args=["sleep", "10000"]).add()
    Container("bash_2", "bash:latest", args=["sleep", "10000"]).add()

pod.print()

Apply the manifest

python test.py | kubectl apply -f -

About

Library to generate Kubernetes manifests using Python code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages