Skip to content

Commit

Permalink
feat: set default for liveness-probe
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 committed Oct 11, 2024
1 parent 5f26a70 commit efcba86
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 142 deletions.
66 changes: 33 additions & 33 deletions charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12930,39 +12930,6 @@ spec:
type: boolean
syslogNG:
properties:
bufferMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetrics:
properties:
interval:
Expand Down Expand Up @@ -13303,6 +13270,39 @@ spec:
format: int32
type: integer
type: object
bufferVolumeMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetricsService:
properties:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@ spec:
type: object
spec:
properties:
bufferMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetrics:
properties:
interval:
Expand Down Expand Up @@ -401,6 +368,39 @@ spec:
format: int32
type: integer
type: object
bufferVolumeMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetricsService:
properties:
metadata:
Expand Down
66 changes: 33 additions & 33 deletions config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12930,39 +12930,6 @@ spec:
type: boolean
syslogNG:
properties:
bufferMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetrics:
properties:
interval:
Expand Down Expand Up @@ -13303,6 +13270,39 @@ spec:
format: int32
type: integer
type: object
bufferVolumeMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetricsService:
properties:
metadata:
Expand Down
66 changes: 33 additions & 33 deletions config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@ spec:
type: object
spec:
properties:
bufferMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetrics:
properties:
interval:
Expand Down Expand Up @@ -401,6 +368,39 @@ spec:
format: int32
type: integer
type: object
bufferVolumeMetricsResources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
bufferVolumeMetricsService:
properties:
metadata:
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/crds/v1beta1/syslogng_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ generated_file: true

SyslogNGSpec defines the desired state of SyslogNG

### bufferMetricsResources (corev1.ResourceRequirements, optional) {#syslogngspec-buffermetricsresources}


### bufferVolumeMetrics (*BufferMetrics, optional) {#syslogngspec-buffervolumemetrics}


Expand All @@ -20,6 +17,9 @@ SyslogNGSpec defines the desired state of SyslogNG
### bufferVolumeMetricsLivenessProbe (*corev1.Probe, optional) {#syslogngspec-buffervolumemetricslivenessprobe}


### bufferVolumeMetricsResources (corev1.ResourceRequirements, optional) {#syslogngspec-buffervolumemetricsresources}


### bufferVolumeMetricsService (*typeoverride.Service, optional) {#syslogngspec-buffervolumemetricsservice}


Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/syslogng/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (r *Reconciler) bufferMetricsSidecarContainer() *corev1.Container {
MountPath: BufferPath,
},
},
Resources: r.syslogNGSpec.BufferMetricsResources,
Resources: r.syslogNGSpec.BufferVolumeMetricsResources,
LivenessProbe: r.syslogNGSpec.BufferVolumeMetricsLivenessProbe,
}
}
Expand Down
16 changes: 16 additions & 0 deletions pkg/sdk/logging/api/v1beta1/fluentd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ func (f *FluentdSpec) SetDefaults() error {
corev1.ResourceCPU: resource.MustParse("2m"),
}
}
if f.BufferVolumeLivenessProbe == nil {
f.BufferVolumeLivenessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Port: intstr.FromString("buffer-metrics"),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: 600,
TimeoutSeconds: 5,
PeriodSeconds: 30,
SuccessThreshold: 1,
FailureThreshold: 3,
}
}

if f.Resources.Limits == nil {
f.Resources.Limits = corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("400M"),
Expand Down
Loading

0 comments on commit efcba86

Please sign in to comment.