{"id":51228019,"url":"https://github.com/paradeum-team/lxcfs-mutatingadmissionwebhook","last_synced_at":"2026-06-28T13:02:13.828Z","repository":{"id":112386405,"uuid":"184975530","full_name":"paradeum-team/lxcfs-mutatingadmissionwebhook","owner":"paradeum-team","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-06T09:38:55.000Z","size":2552,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-15T06:24:19.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/paradeum-team.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":"2019-05-05T03:41:10.000Z","updated_at":"2020-07-10T08:02:29.000Z","dependencies_parsed_at":"2023-05-14T09:45:28.226Z","dependency_job_id":null,"html_url":"https://github.com/paradeum-team/lxcfs-mutatingadmissionwebhook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paradeum-team/lxcfs-mutatingadmissionwebhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradeum-team%2Flxcfs-mutatingadmissionwebhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradeum-team%2Flxcfs-mutatingadmissionwebhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradeum-team%2Flxcfs-mutatingadmissionwebhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradeum-team%2Flxcfs-mutatingadmissionwebhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paradeum-team","download_url":"https://codeload.github.com/paradeum-team/lxcfs-mutatingadmissionwebhook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradeum-team%2Flxcfs-mutatingadmissionwebhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34889047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-28T13:02:10.920Z","updated_at":"2026-06-28T13:02:13.823Z","avatar_url":"https://github.com/paradeum-team.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lxcfs-mutatingadmissionwebhook\n\n## 简介\n此项目使用Kubernetes admission webhooks，在pod创建之前将lxcfs相关目录挂在到容器内。\n\n\n## 部署测试\n\u003e本项目部署在openshift环境上，如果使用k8s将脚本中的oc 改为 kubectl 即可\n\n### 生成secrets\n\n```\n$ ./deployment/webhook-create-signed-cert.sh\n\ncreating certs in tmpdir /var/folders/3z/\\_d8d8kl951ggyvw360dkd_y80000gn/T/tmp.xPApwE5H\nGenerating RSA private key, 2048 bit long modulus\n..............................................+++\n...........+++\ne is 65537 (0x10001)\ncertificatesigningrequest.certificates.k8s.io \"lxcfs-webhook-svc.default\" created\nNAME                                    AGE       REQUESTOR               CONDITION\nadmission-webhook-example-svc.default   1s        ekscluster-marton-423   Pending\ncertificatesigningrequest.certificates.k8s.io \"lxcfs-webhook-svc.default\" approved\nsecret \"lxcfs-webhook-certs\" created\n\n$ oc get secret lxcfs-webhook-certs\nNAME                              TYPE      DATA      AGE\nlxcfs-webhook-certs   Opaque    2         2m\n```\n\n### 权限配置\n\n\n- 创建角色，用户并绑定关系\n\n``` \noc  create -f ./deployment/service-account.yaml \u0026\u0026 oc create -f ./deployment/clusterrole.yaml  \u0026\u0026 oc create -f ./deployment/clusterrolebinding.yaml\n```\n\n- 创建scc\n\n``` \noc create -f ./deployment/lxcfs-webhook-scc.yaml --validate=false\n\n```\n\n\n### 创建deployment和service\n\n\n```\n$ oc create -f deployment/deployment.yaml\ndeployment.apps \"lxcfs-webhook-deployment\" created\n\n$ oc create -f deployment/service.yaml\nservice \"lxcfs-webhook-svc\" created\n\n```\n\n### 配置webhook \n\n\n```\n$ cat ./deployment/mutatingwebhook.yaml | ./deployment/webhook-patch-ca-bundle.sh \u003e ./deployment/mutatingwebhook-ca-bundle.yaml\n\n$ kubectl create -f deployment/mutatingwebhook-ca-bundle.yaml\nmutatingwebhookconfiguration.admissionregistration.k8s.io \"lxcfs-webhook-cfg\" created\n\n```\n\n### 标记namespace\n\n\n```\n$ kubectl label namespace default lxcfs-webhook=enabled\nnamespace \"default\" labeled\n```\n\n### 测试（webhook将会自动挂载lxcfs相关目录）\n\nsleep 测试容器需要有挂载卷的权限\n\n```\n$ kubectl create -f deployment/sleep.yaml\n\n```\n\n### 黑名单和白名单模式\n\u003e项目支持黑白名单模式，在deployment中配置环境变量 ‘BLACK_OR_WHITE’  ，BLACK为黑名单模式，WHITE 为白名单模式，默认为黑名单模式。\n\n```\n env:\n - name: BLACK_OR_WHITE\n   value: BLACK\n```\n\u003e黑名单模式下，应用带有 lxcfs-webhook.paradeum.com/mutate=false 注解，webhook将不进行修改\n\n\n\u003e白名单模式下，应用带有 lxcfs-webhook.paradeum.com/mutate=true 注解，webhook将进行修改\n\n## 参考文献\n[Kubernetes 准入控制 Admission Controller 介绍](https://juejin.im/post/5ba3547ae51d450e425ec6a5)\n\n[Diving into Kubernetes MutatingAdmissionWebhook](https://medium.com/ibm-cloud/diving-into-kubernetes-mutatingadmissionwebhook-6ef3c5695f74)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadeum-team%2Flxcfs-mutatingadmissionwebhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparadeum-team%2Flxcfs-mutatingadmissionwebhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadeum-team%2Flxcfs-mutatingadmissionwebhook/lists"}