Skip to content

Commit 59a2316

Browse files
authored
Merge pull request fluent#1204 from smallc2009/add-daemonset-termination-grace-period-seconds
Add daemonset terminationGracePeriodSeconds
2 parents 765877a + 3ba88dd commit 59a2316

File tree

10 files changed

+48
-5
lines changed

10 files changed

+48
-5
lines changed

apis/fluentbit/v1alpha2/fluentbit_types.go

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ type FluentBitSpec struct {
105105
Service FluentBitService `json:"service,omitempty"`
106106
// SchedulerName represents the desired scheduler for fluent-bit pods.
107107
SchedulerName string `json:"schedulerName,omitempty"`
108+
// Optional duration in seconds the pod needs to terminate gracefully. Value must be non-negative integer.
109+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
108110
}
109111

110112
// FluentBitService defines the service of the FluentBit

apis/fluentbit/v1alpha2/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_fluentbits.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -4673,6 +4673,11 @@ spec:
46734673
type: string
46744674
description: Annotations to add to the Fluentbit service account
46754675
type: object
4676+
terminationGracePeriodSeconds:
4677+
description: Optional duration in seconds the pod needs to terminate
4678+
gracefully. Value must be non-negative integer.
4679+
format: int64
4680+
type: integer
46764681
tolerations:
46774682
description: Tolerations
46784683
items:

config/crd/bases/fluentbit.fluent.io_fluentbits.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -4673,6 +4673,11 @@ spec:
46734673
type: string
46744674
description: Annotations to add to the Fluentbit service account
46754675
type: object
4676+
terminationGracePeriodSeconds:
4677+
description: Optional duration in seconds the pod needs to terminate
4678+
gracefully. Value must be non-negative integer.
4679+
format: int64
4680+
type: integer
46764681
tolerations:
46774682
description: Tolerations
46784683
items:

docs/fluentbit.md

+1
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ FluentBitSpec defines the desired state of FluentBit
428428
| metricsPort | MetricsPort is the port used by the metrics server. If this option is set, HttpPort from ClusterFluentBitConfig needs to match this value. Default is 2020. | int32 |
429429
| service | Service represents configurations on the fluent-bit service. | FluentBitService |
430430
| schedulerName | SchedulerName represents the desired scheduler for fluent-bit pods. | string |
431+
| terminationGracePeriodSeconds | Optional duration in seconds the pod needs to terminate gracefully. Value must be non-negative integer. | *int64 |
431432

432433
[Back to TOC](#table-of-contents)
433434
# InputSpec

go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ require (
5959
go.uber.org/atomic v1.9.0 // indirect
6060
go.uber.org/multierr v1.7.0 // indirect
6161
go.uber.org/zap v1.24.0 // indirect
62+
golang.org/x/mod v0.12.0 // indirect
6263
golang.org/x/net v0.23.0 // indirect
6364
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
6465
golang.org/x/sys v0.18.0 // indirect
6566
golang.org/x/term v0.18.0 // indirect
6667
golang.org/x/text v0.14.0 // indirect
6768
golang.org/x/time v0.3.0 // indirect
69+
golang.org/x/tools v0.12.0 // indirect
6870
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
6971
google.golang.org/appengine v1.6.7 // indirect
7072
google.golang.org/protobuf v1.33.0 // indirect
@@ -73,7 +75,9 @@ require (
7375
gopkg.in/yaml.v2 v2.4.0 // indirect
7476
gopkg.in/yaml.v3 v3.0.1 // indirect
7577
k8s.io/apiextensions-apiserver v0.26.1 // indirect
78+
k8s.io/code-generator v0.26.1 // indirect
7679
k8s.io/component-base v0.26.1 // indirect
80+
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
7781
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
7882
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
7983
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect

go.sum

+10
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
8989
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
9090
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
9191
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
92+
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
9293
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
9394
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
9495
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
@@ -355,6 +356,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
355356
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
356357
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
357358
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
359+
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
360+
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
358361
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
359362
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
360363
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -510,6 +513,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs
510513
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
511514
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
512515
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
516+
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
513517
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
514518
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
515519
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -648,8 +652,13 @@ k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs=
648652
k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
649653
k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s=
650654
k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ=
655+
k8s.io/code-generator v0.26.1 h1:dusFDsnNSKlMFYhzIM0jAO1OlnTN5WYwQQ+Ai12IIlo=
656+
k8s.io/code-generator v0.26.1/go.mod h1:OMoJ5Dqx1wgaQzKgc+ZWaZPfGjdRq/Y3WubFrZmeI3I=
651657
k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4=
652658
k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU=
659+
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08=
660+
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
661+
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
653662
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
654663
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
655664
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
@@ -665,5 +674,6 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm
665674
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
666675
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
667676
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
677+
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
668678
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
669679
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

manifests/setup/fluent-operator-crd.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -18758,6 +18758,11 @@ spec:
1875818758
type: string
1875918759
description: Annotations to add to the Fluentbit service account
1876018760
type: object
18761+
terminationGracePeriodSeconds:
18762+
description: Optional duration in seconds the pod needs to terminate
18763+
gracefully. Value must be non-negative integer.
18764+
format: int64
18765+
type: integer
1876118766
tolerations:
1876218767
description: Tolerations
1876318768
items:

manifests/setup/setup.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -18758,6 +18758,11 @@ spec:
1875818758
type: string
1875918759
description: Annotations to add to the Fluentbit service account
1876018760
type: object
18761+
terminationGracePeriodSeconds:
18762+
description: Optional duration in seconds the pod needs to terminate
18763+
gracefully. Value must be non-negative integer.
18764+
format: int64
18765+
type: integer
1876118766
tolerations:
1876218767
description: Tolerations
1876318768
items:

pkg/operator/daemonset.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ func MakeDaemonSet(fb fluentbitv1alpha2.FluentBit, logPath string) *appsv1.Daemo
8888
SecurityContext: fb.Spec.ContainerSecurityContext,
8989
},
9090
},
91-
NodeSelector: fb.Spec.NodeSelector,
92-
Tolerations: fb.Spec.Tolerations,
93-
Affinity: fb.Spec.Affinity,
94-
SecurityContext: fb.Spec.SecurityContext,
95-
HostNetwork: fb.Spec.HostNetwork,
91+
NodeSelector: fb.Spec.NodeSelector,
92+
Tolerations: fb.Spec.Tolerations,
93+
Affinity: fb.Spec.Affinity,
94+
SecurityContext: fb.Spec.SecurityContext,
95+
HostNetwork: fb.Spec.HostNetwork,
96+
TerminationGracePeriodSeconds: fb.Spec.TerminationGracePeriodSeconds,
9697
},
9798
},
9899
},

0 commit comments

Comments
 (0)