8000 GitHub - kubegc/vm-hook: A mutating admission webhook for kube-stack CRD.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kubegc/vm-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kube-stack label webhook

流程

# 1. 创建csr.conf,创建key+cert
# 2. 创建CertificateSigningRequest
# 3. apiserver approve csr
# 4. apiserver创建secret(webhook-demo-secret)
# 5. 存储key-cert到本地
sh scripts/webhook_create_apiserver_certs.sh 
  • 部署webhook
# delete & rebuild & re-deploy
sh scripts/rebuild_webhook.sh 
  • 测试
# 没有host label,有其他label
kubectl apply -f test/resources/create-vm.json

# 有host label,value!="vm"
kubectl apply -f test/resources/create-vm-2.json

mutating逻辑

mutating webhook

  • 作用域范围

    • apiVersion: doslab.io/v1
    • Kind: VirtualMachine
  • /mutate/add-label:采用patch的方式

    • 检查是否存在key=host的label
      • 无则add
      • 有且value!="vm.{xxx}",则update

About

A mutating admission webhook for kube-stack CRD.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0