Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmwylie19/admission-controller
Kubernetes Admission controller to mimic OpenShift admission controllers
https://github.com/cmwylie19/admission-controller
admission-controller admission-webhook kubernetes
Last synced: about 1 month ago
JSON representation
Kubernetes Admission controller to mimic OpenShift admission controllers
- Host: GitHub
- URL: https://github.com/cmwylie19/admission-controller
- Owner: cmwylie19
- License: mit
- Created: 2022-06-04T13:37:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:56:37.000Z (over 1 year ago)
- Last Synced: 2024-06-21T02:02:27.113Z (6 months ago)
- Topics: admission-controller, admission-webhook, kubernetes
- Language: Go
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Admission Controller
The controller applies sensible defaults for pod's securityContext `runAsUser` value. It validates that security context `runAsNonRoot` is not defined when `runAsUser` is set to 0, as you cannot run as nonRoot and run as user 0. If no `runAsUser` value is defined, it will assign a default value of 2000.
- [Prepare Images](#prepare-images)
- [Deploy Admission Controller](#deploy-admission-controller)
- [Verify Admission Controller](#verify-admission-controller)## Prepare Images
The project can be built by running `make`. The images are pushed by running `make push-image`.
## Deploy Admission Controller
To deploy, run the `prepare.sh` in your terminal to create a CA, certificate, and private key for the controller and generate the secret, and the deployment manifests.
```bash
kubectl apply -f k8s/ns.yamlkubectl apply -f k8s/secret-webhook-server-tls.yaml
kubectl apply -f k8s/admission-controller.yaml
```## Verify Admission Controller
First, apply a pod with a conflicting securityContext. We will define `runAsUser` equal to 0, and `runAsNonRoot`.
```yaml
kubectl apply -f -<