Ingress Enforcer, Kubernetes Admission Plugin
ingress-enforcer is a Kubernetes Admission Plugin that does the following:
ingress-enforcer was born out of the need to control ingress usage in a multi tenant Kubernetes cluster. Here's some problems that this admission plugin may solve for you:
The following features are currently working:
The following features are coming soon:
This project was started by a System Admin who is new to Go, but wanting to do things right eventually. The project needs the following things done eventually and contributions are welcome!
ingress-enforcer containerized builds are uploaded to Docker Hub. The container is built from scratch image and only includes the ingress-enforcer binary making it very small in both size and security footprint. The container runs as non-root and listens on port 8443.
ingress-enforcer can run within the Kubernetes cluster it is serving and is the recommended configuration option.
Kubernetes requires that communication to the webhook happens over a verified TLS connection. If you stick with the default configurations in /deploy, you will need to provide a cert keypair for common name ingress-enforcer-service.kube-system.svc (change this if you change your service name, they should match). If this certificate pair is created by a certificate authority not trusted by the system's certificate store (i.e. because you don't want to go through the trouble of adding the CA or you don't have access to it such as in GKE or EKS) you'll need to also include the caBundle option in your webhook configuration so Kubernetes will trust your cert keypair.
A quick tutorial for creating your own CA and certs is available here.
As stated above, if you are creating a cert keypair using a certificate authority that isn't in the Kubernetes system certificate store, you have to state a caBundle in your webhook configuration in base64 format. Assuming you've followed the tutorial above and have a CA certificate ready:
base64 -w 0 cacert.pem
The above command should provide you with a base64 encoded string for use in the webhookconfigurations.yaml in the /deploy directory of this repository within the caBundle fields.
If you are using a cert pair that is trusted by your cluster by default, you can remove the caBundle fields.
You will need to create a Kubernetes Secret to hold your cert keypair. In the /deploy directory of this repository we have a template you can use called secret-template.yaml. Either use this file once and trash it or pipeline its secret data so the cert keypair doesn't get committed to version control.
The secret data will need to be base64 encoded. You can do that with the following commands:
base64 -w 0 server.crt
base64 -w 0 server.key
Now that you have your cert prep out of the way, deploy ingress-enforcer as follows:
configmap.yaml and secret.yaml,deployment.yaml and service.yaml,webhookconfigurations.yaml.If all goes as planned, you should have a functioning installation of ingress-enforcer running in the kube-system namespace.
GKE clusters enable the --enable-aggregator-routing option because the API server is unable to route service IP addresses. This causes it to attempt a connection directly to the ingress-enforcer pod on port 8443 instead. If creating ingresses hangs with an eventual timeout, you may need to adjust your firewall to allow the GKE master to communicate in to your nodes on port 8443.
This seems troublesome, but running the pod on port 443 (usually automatically opened by GKE) would have required running the container as root which is bad practice and may not be allowed in some environments.
Content type
Image
Digest
Size
5.6 MB
Last updated
about 7 years ago
docker pull icebal/ingress-enforcer