CLI tool to create and manage Kubernetes deployments
- Currently supported operating systems: GNU/Linux
- Install uv
- Access to a Kubernetes cluster using a
kubeconfigfile
uv tool install --from git+https://github.com/byoms/kdctl kdctlThis installs the utility as a user local binary that can be invoked using kdctl. More details: here
To get started & explore all the switches use --help
kdctl --help- There are primarily 2 categories of users: Admins and Developers.
- The Developers belong to different teams within the organization are users of the Kubernetes platform.
- The Admins are part of a central team manage and operate the Kubernetes cluster infra, define governance policies.
- Resources are isolated at a per-team level i.e each team is allocated a namespace. It operates within & has access access limited to that namespace.
- The namespaces need to be created once per team - it is the responsibility of Admins to facilitate this
All application deployments need to be defined in a deployment spec file. It is a yaml file expected in a particular structure. Here is a sample for ref.: demo.yaml. It contains necessary details required for the deployment. Most fields are fairly self explanatory
The tool uses the kubeconfig file to access the target Kubernetes cluster. There is an option to specify a custom path, if not it tries to use the default
location: $HOME/.kube/config
Based on the above, lets consider a scenario. There is a new dev team named devx and they have created an app named txapp (using demo.yaml) that they want to run on Kubernetes. They are expected to first request the Admins to create a namespace for them and provide them with a kubeconfig file to access the cluster
kubectl create ns devxAfter this, the dev team defines the deployment spec file and can create the deployment from CLI in the form of:
kdctl create txapp.yaml --kubeconfig /path/to/user/kubeconfigThe tool also supports getting basic info of a deployment that is already created.
Note assumption: The current implementation assumes the name of the app that is deployed (the name field in deployment spec) as the unique identifier for
a deployment for a given team - as it is highly unlikely to collide
The deployment info can be obtained for the above example using the team and app name
kdctl get devx txapp --kubeconfig /path/to/user/kubeconfig- Support horizontal pod autoscaling based on resource utilisation
- Support autoscaling based on external systems using KEDA