Skip to content
/ k8sodep Public

一个用于生产环境的K8s重部署插件

Notifications You must be signed in to change notification settings

sxueck/k8sodep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kuberneteus Redeployment Plugin

这是一个使用 Client-go 编写的插件,通过 WebHook 的方式,能够及时触发指定 Deployment 的 Images 修改和重部署

This is a plugin written using Client-go that can trigger the timely modification and redeployment of specified Deployments' images through WebHook.

How to Redeployment a Service

Example:

## Request
curl -X "POST" "DOMAIN/webhook" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "namespace": "kube-public",
  "deployment": "k3s-reploy-webhook",
  "images": "registry.cn-shenzhen.aliyuncs.com/sxueck/k3s-webhook",
  "tag": "v1.1",
  "replicas": 1,
  "access-token": "token-xxx",
  "containers": "k3s-reploy-webhook"
}'
  • images: the image name
  • access-token: can be extracted from the environment variable ACCESS_TOKEN
  • namespace: the namespace of the deployment
  • replicas: the number of replicas, default 1
  • tag: image tag
  • resource: resource name, it will automatically determine whether it is Deployment or StatefulSet
  • containers (optional): prevent multiple image in one pod, image name, if this is empty, it is automatically the same as the resource name

About

一个用于生产环境的K8s重部署插件

Resources

Stars

Watchers

Forks

Packages

No packages published