{"id":18726871,"url":"https://github.com/curium-rocks/k8s-mutating-webhook","last_synced_at":"2026-05-01T16:35:04.891Z","repository":{"id":59233316,"uuid":"535414541","full_name":"curium-rocks/k8s-mutating-webhook","owner":"curium-rocks","description":"A starter template for a kubernetes dynamic admission mutating web-hook.","archived":false,"fork":false,"pushed_at":"2025-02-04T22:12:50.000Z","size":916,"stargazers_count":0,"open_issues_count":19,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-04T23:20:56.934Z","etag":null,"topics":["helm","k8s","kubernetes","mutating-webhook","node","nodejs","starter-template","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curium-rocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-09-11T20:13:37.000Z","updated_at":"2023-07-18T09:16:21.000Z","dependencies_parsed_at":"2024-03-18T13:27:43.289Z","dependency_job_id":"de546cdb-8420-4fe6-96d5-7ed09cee4f71","html_url":"https://github.com/curium-rocks/k8s-mutating-webhook","commit_stats":null,"previous_names":[],"tags_count":3,"template":true,"template_full_name":"curium-rocks/k8s-validating-webhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curium-rocks%2Fk8s-mutating-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curium-rocks%2Fk8s-mutating-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curium-rocks%2Fk8s-mutating-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curium-rocks%2Fk8s-mutating-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curium-rocks","download_url":"https://codeload.github.com/curium-rocks/k8s-mutating-webhook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239592971,"owners_count":19664855,"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":["helm","k8s","kubernetes","mutating-webhook","node","nodejs","starter-template","typescript"],"created_at":"2024-11-07T14:15:45.450Z","updated_at":"2025-11-11T21:30:20.888Z","avatar_url":"https://github.com/curium-rocks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-mutating-webhook\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=curium-rocks_k8s-mutating-webhook\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=curium-rocks_k8s-mutating-webhook)\n\nThis template provides a kick start to making a kubernetes admission controller using TypeScript and Node.JS, uses a Mutating Webhook.\n- [Kubernetes-client/client-node](https://github.com/kubernetes-client/javascript)\n- [Jest](https://github.com/facebook/jest)\n- [Github Action CI](.github/workflows/ci.yaml)\n- [Renovate](https://github.com/renovatebot/renovate)\n- [Eslint (with standard config)](https://github.com/standard/eslint-config-standard)\n- [Typescript](https://github.com/Microsoft/TypeScript)\n- [Config](https://github.com/node-config/node-config)\n- [Pino](https://github.com/pinojs/pino)\n- [Fastify](https://github.com/fastify/fastify)\n- [Fast Json Patch](https://github.com/Starcounter-Jack/JSON-Patch)\n- [InversifyJS](https://github.com/inversify/InversifyJS)\n- [Sonar Project File](./sonar-project.properties)\n- [Dockerfile](./Dockerfile)\n\n\n## NPM Scripts\nThe following scripts are included in the NPM project configuration\n- `lint` lints the source code using eslint\n- `lint:fix` automatically fixes any lint errors that can be fixed automatically\n- `test` uses jest to run test suites\n- `test:e2e` runs e2e test suite, this requires an active helm:deploy\n- `build` compiles the typescript into js and places it in the `dist` folder\n- `build:image` builds the container image\n- `minikube:start` create a minikube k8s cluster\n- `minikube:stop` stop minikube but do not delete\n- `minikube:delete` delete the minikube cluster\n- `helm:addRepos` adds helm repos\n- `helm:deployCertManager` deploy cert-manager for TLS\n- `helm:deploy` deploy the app to k8s using helm\n- `helm:template` print the k8s yaml that would be applied to k8s when using `helm:deploy`\n- `helm:uninstall` remove the app from k8s\n- `helm:uninstallCertManager` remove cert-manager from the k8s cluster\n\n## Deploy it\nIf you don't already have cert manager installed you will need to run:\n\n``` bash\nhelm repo add jetstack https://charts.jetstack.io \u0026\u0026 helm repo update \u0026\u0026 \\\n  helm upgrade --install --namespace cert-manager --create-namespace \\\n  cert-manager jetstack/cert-manager --set installCRDs=true --debug --wait\n```\n\nAdd the helm repos `helm repo add k8s https://curium-rocks.github.io/k8s-mutating-webhook` fetch updates `helm repo update`. \n\nVerify it worked `helm search repo k8s` and you should see something like.\n\n```\nNAME                                                    CHART VERSION   APP VERSION     DESCRIPTION                                       \nk8s/k8s-mutating-webhook...      0.1.0           0.1.0           A starter template for a dynamic admission mut...\n```\n\nDeploy the app `helm upgrade --install starter k8s/k8s-mutating-webhook`\n\nVerify it worked `kubectl run testpod --image=busybox`, this will be changed, fetch it's yaml `kubectl get testpod -o yaml` you will see its `securityContext`'s have been enhanced.\n\n\n## Structure\n### [Services](./src/services/)\nThis is meant to include service abstractions, ideally each service should provide an interface/contract \nexposing the functionality that other things in the application need.\n### [Entities](./src/entities/)\nCurrently this is setup to house factories or other items to provide instances of third party things/modules that will be bound by the InversifyJS IoC container so they can be injected into other things with `@inject()`\n\n### [Models](./src/models/)\nThis houses interfaces/models with little to no logic, the intent is these items can be passed/returned from the abstractions in services and avoid tight coupling to third party types.\n\n### [types.ts](./src/types.ts)\nThis defines symbols for each type that will be configured in the IoC container, these are used to identify the type when using `@inject(TYPES.Services.Kubernetes)` for example. For more information refer to [inversify](https://github.com/inversify/InversifyJS).\n\n\n### [inversify.config.ts](./src/inversify.config.ts)\nThis file maps the types defined in `./src/types.ts` to interface types. For more information refer to [inversify](https://github.com/inversify/InversifyJS).\n\n## After Using as Template Todo List\n1) [ ] Update Sonar Project Properties For [Sonar Cloud](https://sonarcloud.io)\n2) [ ] Add SONARQUBE_KEY secret to your repo or org if not already present\n3) [ ] Point badges in README.md to correct location for you repo\n3) [ ] Update [renovate.json](./renovate.json) to meet desired behavior for your needs, docs can be found [here](https://docs.renovatebot.com).\n4) [ ] Update this readme to reflect your project name and info\n5) [ ] Rename all `k8s-mutating-webhook` references to match your project name","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurium-rocks%2Fk8s-mutating-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurium-rocks%2Fk8s-mutating-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurium-rocks%2Fk8s-mutating-webhook/lists"}