Skip to content

Commit

Permalink
feat: add readiness & liveness probe for fluentd (#980)
Browse files Browse the repository at this point in the history
* add types for readiness/liveness probe

Signed-off-by: juicer <cwguoz@gmail.com>

* readiness probe and liveness probe for fluentd

Signed-off-by: juicer <cwguoz@gmail.com>

* generated docs

Signed-off-by: juicer <cwguoz@gmail.com>

---------

Signed-off-by: juicer <cwguoz@gmail.com>
  • Loading branch information
cw-Guo committed Nov 6, 2023
1 parent fb92dfa commit 516c17b
Show file tree
Hide file tree
Showing 9 changed files with 1,164 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/fluentd/v1alpha1/fluentd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ type FluentdSpec struct {
// Storage for position db. You will use it if tail input is enabled.
// Applicable when the mode is "agent", and will be ignored when the mode is "collector"
PositionDB corev1.VolumeSource `json:"positionDB,omitempty"`
// LivenessProbe represents the liveness probe for the fluentd container.
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
// ReadinessProbe represents the readiness probe for the fluentd container.
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
}

// FluentDService the service of the FluentD
Expand Down
10 changes: 10 additions & 0 deletions apis/fluentd/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

286 changes: 286 additions & 0 deletions config/crd/bases/fluentd.fluent.io_fluentds.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/fluentd.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ FluentdSpec defines the desired state of Fluentd
| mode | Mode to determine whether to run Fluentd as collector or agent. | string |
| containerSecurityContext | ContainerSecurityContext represents the security context for the fluentd container. | *corev1.SecurityContext |
| positionDB | Storage for position db. You will use it if tail input is enabled. Applicable when the mode is \"agent\", and will be ignored when the mode is \"collector\" | [corev1.VolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#volume-v1-core) |
| livenessProbe | LivenessProbe represents the liveness probe for the fluentd container. | *corev1.Probe |
| readinessProbe | ReadinessProbe represents the readiness probe for the fluentd container. | *corev1.Probe |

[Back to TOC](#table-of-contents)
# FluentdStatus
Expand Down
286 changes: 286 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml

Large diffs are not rendered by default.

286 changes: 286 additions & 0 deletions manifests/setup/setup.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pkg/operator/fluentd-daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func MakeFluentdDaemonSet(fd fluentdv1alpha1.Fluentd) *appsv1.DaemonSet {
},
},
SecurityContext: fd.Spec.ContainerSecurityContext,
LivenessProbe: fd.Spec.LivenessProbe,
ReadinessProbe: fd.Spec.ReadinessProbe,
},
},
NodeSelector: fd.Spec.NodeSelector,
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/sts.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func MakeStatefulSet(fd fluentdv1alpha1.Fluentd) *appsv1.StatefulSet {
Value: BufferMountPath,
},
},
ReadinessProbe: fd.Spec.ReadinessProbe,
LivenessProbe: fd.Spec.LivenessProbe,
},
},
NodeSelector: fd.Spec.NodeSelector,
Expand Down

0 comments on commit 516c17b

Please sign in to comment.