This project implements a Kubernetes Mutating Admission Webhook for pod resources. The webhook mutates the pod objects by modifying the environment variables of containers in the pod.
Dockerfile,Makefile,README.md: Project build, configuration, and documentation files. 🛠️certs: SSL/TLS certificate-related files for secure communication 🔒.client: Client-side HTTP requests for testing or interacting with the webhook 💻.cmd: The main application entry point (e.g., starting the server) 🚀.docs: Documentation for certificates and Docker usage 📖.manifests: Kubernetes resources for deploying and managing the webhook in a Kubernetes cluster ☸️.pkg: Core application logic, including configuration, webhook handlers, and mutation logic 🔧.
Before you start, make sure you have the following tools installed:
- Kind 🛠️
- Docker 🐳
- kubectl 🛑
- kustomize 🧩
- Go (for development) 🖥️
- Kind cluster configuration:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.32.2
- role: worker
image: kindest/node:v1.32.2
- role: worker
image: kindest/node:v1.32.2- Apply the cluster configuration:
kind create cluster --config kind.yamlFollow the instructions to generate the necessary certificates for the webhook.
Follow the instructions to build and push the Docker image to a container registry.
make deployTest the webhook with the following command:
kubectl apply -f manifests/examples/pod.yamlTo clean up:
make undeploy
kind delete clusterThe webhook mutates pods to add a specific label and annotation based on the configuration.
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
This project and everyone participating in it is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project team.
The goal of this code of conduct is to ensure a welcoming, respectful, and productive environment for all contributors. The expectations are:
- Be respectful: Treat everyone with kindness and empathy.
- Be inclusive: Embrace diversity of thought, background, and perspective.
- Be responsible: Take ownership of your contributions and interactions.
- Be collaborative: Foster a cooperative environment where knowledge sharing is encouraged.
For more details, please refer to the full Code of Conduct.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you find this project useful, please consider giving it a ⭐️ on GitHub. Your star helps us reach more developers and contributors and supports the continued improvement of the project. It’s a great way to show appreciation! 😊
