mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 21:03:22 +00:00
Adding initial version of Kubernetes backend (#552)
Co-authored-by: laszlocph <laszlo@laszlo.cloud> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Rynoxx <rynoxx@grid-servers.net>
This commit is contained in:
@@ -35,6 +35,7 @@ import (
|
||||
|
||||
"github.com/woodpecker-ci/woodpecker/agent"
|
||||
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
|
||||
"github.com/woodpecker-ci/woodpecker/pipeline/backend/types"
|
||||
"github.com/woodpecker-ci/woodpecker/pipeline/rpc"
|
||||
"github.com/woodpecker-ci/woodpecker/shared/utils"
|
||||
"github.com/woodpecker-ci/woodpecker/version"
|
||||
@@ -134,6 +135,8 @@ func loop(c *cli.Context) error {
|
||||
sigterm.Set()
|
||||
})
|
||||
|
||||
backend.Init(context.WithValue(ctx, types.CliContext, c))
|
||||
|
||||
var wg sync.WaitGroup
|
||||
parallel := c.Int("max-procs")
|
||||
wg.Add(parallel)
|
||||
|
@@ -106,4 +106,32 @@ var flags = []cli.Flag{
|
||||
Usage: "backend engine to run pipelines on",
|
||||
Value: "auto-detect",
|
||||
},
|
||||
|
||||
// TODO: add flags of backends
|
||||
|
||||
// backend k8s
|
||||
&cli.StringFlag{
|
||||
EnvVars: []string{"WOODPECKER_BACKEND_K8S_NAMESPACE"},
|
||||
Name: "backend-k8s-namespace",
|
||||
Usage: "backend k8s namespace",
|
||||
Value: "woodpecker",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
EnvVars: []string{"WOODPECKER_BACKEND_K8S_VOLUME_SIZE"},
|
||||
Name: "backend-k8s-volume-size",
|
||||
Usage: "backend k8s volume size (default 10G)",
|
||||
Value: "10G",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
EnvVars: []string{"WOODPECKER_BACKEND_K8S_STORAGE_CLASS"},
|
||||
Name: "backend-k8s-storage-class",
|
||||
Usage: "backend k8s storage class",
|
||||
Value: "",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
EnvVars: []string{"WOODPECKER_BACKEND_K8S_STORAGE_RWX"},
|
||||
Name: "backend-k8s-storage-rwx",
|
||||
Usage: "backend k8s storage access mode, should ReadWriteMany (RWX) instead of ReadWriteOnce (RWO) be used? (default: true)",
|
||||
Value: true,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user