{"id":21660813,"url":"https://github.com/mohammadll/kubernetes-validating-admission-webhook","last_synced_at":"2026-05-11T09:28:11.234Z","repository":{"id":178400929,"uuid":"661805479","full_name":"mohammadll/kubernetes-validating-admission-webhook","owner":"mohammadll","description":"validating admission webhook","archived":false,"fork":false,"pushed_at":"2023-10-19T20:15:08.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T07:11:14.777Z","etag":null,"topics":["kubernetes","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohammadll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-03T17:32:14.000Z","updated_at":"2024-01-07T08:04:48.000Z","dependencies_parsed_at":"2024-06-22T17:32:43.778Z","dependency_job_id":null,"html_url":"https://github.com/mohammadll/kubernetes-validating-admission-webhook","commit_stats":null,"previous_names":["mohammadll/kubernetes-validating-admission-webhook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fkubernetes-validating-admission-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fkubernetes-validating-admission-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fkubernetes-validating-admission-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fkubernetes-validating-admission-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadll","download_url":"https://codeload.github.com/mohammadll/kubernetes-validating-admission-webhook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244556638,"owners_count":20471661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","python"],"created_at":"2024-11-25T09:38:58.012Z","updated_at":"2026-05-11T09:28:11.153Z","avatar_url":"https://github.com/mohammadll.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubernetes-validating-admission-webhook\n\n## What are admission webhooks? \n\nAdmission webhooks are HTTP callbacks that receive admission requests and do something with them. You can define two types of admission webhooks, validating admission webhook and mutating admission webhook. Mutating admission webhooks are invoked first, and can modify objects sent to the API server to enforce custom defaults. After all object modifications are complete, and after the incoming object is validated by the API server, validating admission webhooks are invoked and can reject requests to enforce custom policies.\n\n#### Visit this link : https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/\n\n----\nIn this repository, I tried to show you its power . Maybe we want to prevent deployments that contain images with the \u003c\u003c latest \u003e\u003e tag from being applied in the production environment . I wrote a script using flask  , So if a someone tries to apply deployments in production namespace, They will get an error message to change the image tag from \u003c\u003c latest \u003e\u003e\n\n\nStep 1:\n\n```\ndocker build -t validate:v1 .\n```\n\nStep2:\n\n```\nkubectl apply -f validating-admission-controller.yml\n```\n\nTest the validation:\n\n```\nkubectl create deployment nginx --image=nginx --replicas=1 -n production\n```\ntest it to check it works by the above command!\nyou will get an error message to change the tag from latest to something else\n\nif you deploy it in prod or production namespaces , the error meesage appears\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadll%2Fkubernetes-validating-admission-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadll%2Fkubernetes-validating-admission-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadll%2Fkubernetes-validating-admission-webhook/lists"}