Skip to content

ZachBurm/admission-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Problem Statement:

We use namespace isolation to allow engineering teams to share Kubernetes resources safely. But DNS is global so we need to put guardrails in place so that no two services can use the same ingress hostname. How can we enforce that within the cluster?

Expected Output:

Your code should be stored in a publicly accessible location.

Dev Environment

  • minikube
  • minikube ingress-dns plugin

Outcome

  • some ingress controller will, by default, prevent duplicate hostnames in different namespaces with their admission controllers
  • we will use a the ValidatingAdmissionWebhook admission controller to enforce an fqdn policy

References & Credit

Helpful commands

# load docker image to minikube
minikube image load hostnamevalidator

# approve cert generating by wcg
kubectl certificate approve validator.default.svc

# generate certs for the server and ca bundle for the VAW
go run cmd/webhook-certificate-generator/main.go --service-name=validator --namespace=default --secret-name=validator-certs --in-cluster=false -k ~/.kube/config --patch-validating=validator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published