mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-20 02:35:42 +00:00
Allow Flux to be deployed on tainted Kubernetes nodes
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
fa6e3d3706
commit
37f5587085
11 changed files with 42 additions and 7 deletions
|
|
@ -24,6 +24,7 @@ import (
|
|||
|
||||
func TestGenerate(t *testing.T) {
|
||||
opts := MakeDefaultOptions()
|
||||
opts.TolerationKeys = []string{"node.kubernetes.io/controllers"}
|
||||
output, err := Generate(opts)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -36,5 +37,9 @@ func TestGenerate(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
if !strings.Contains(output.Content, opts.TolerationKeys[0]) {
|
||||
t.Errorf("toleration key '%s' not found", opts.TolerationKeys[0])
|
||||
}
|
||||
|
||||
fmt.Println(output)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ type Options struct {
|
|||
Timeout time.Duration
|
||||
TargetPath string
|
||||
ClusterDomain string
|
||||
TolerationKeys []string
|
||||
}
|
||||
|
||||
func MakeDefaultOptions() Options {
|
||||
|
|
|
|||
|
|
@ -137,6 +137,13 @@ spec:
|
|||
imagePullSecrets:
|
||||
- name: {{.ImagePullSecret}}
|
||||
{{- end }}
|
||||
{{ if gt (len .TolerationKeys) 0 }}
|
||||
tolerations:
|
||||
{{- range $i, $key := .TolerationKeys }}
|
||||
- key: "{{$key}}"
|
||||
operator: "Exists"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
`
|
||||
|
||||
var labelsTmpl = `---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue