diff --git a/api/fluentbitoperator/v1alpha2/fluentbit_types.go b/api/fluentbitoperator/v1alpha2/fluentbit_types.go index 9e1f99406..3f7eccd84 100644 --- a/api/fluentbitoperator/v1alpha2/fluentbit_types.go +++ b/api/fluentbitoperator/v1alpha2/fluentbit_types.go @@ -52,6 +52,8 @@ type FluentBitSpec struct { Secrets []string `json:"secrets,omitempty"` // RuntimeClassName represents the container runtime configuration. RuntimeClassName string `json:"runtimeClassName,omitempty"` + // PriorityClassName represents the pod's priority class. + PriorityClassName string `json:"priorityClassName,omitempty"` } // FluentBitStatus defines the observed state of FluentBit diff --git a/charts/fluentbit-operator/crds/logging.kubesphere.io_fluentbit.yaml b/charts/fluentbit-operator/crds/logging.kubesphere.io_fluentbit.yaml index c036d808b..10122f8bc 100644 --- a/charts/fluentbit-operator/crds/logging.kubesphere.io_fluentbit.yaml +++ b/charts/fluentbit-operator/crds/logging.kubesphere.io_fluentbit.yaml @@ -1867,6 +1867,9 @@ spec: runtimeClassName: description: RuntimeClassName represents the container runtime configuration. type: string + priorityClassName: + description: PriorityClassName represents the pod priority class. + type: string secrets: description: The Secrets are mounted into /fluent-bit/secrets/. items: diff --git a/config/crd/bases/logging.kubesphere.io_fluentbits.yaml b/config/crd/bases/logging.kubesphere.io_fluentbits.yaml index b41ad011d..639a07777 100644 --- a/config/crd/bases/logging.kubesphere.io_fluentbits.yaml +++ b/config/crd/bases/logging.kubesphere.io_fluentbits.yaml @@ -2289,6 +2289,9 @@ spec: - volumePath type: object type: object + priorityClassName: + description: PriorityClassName represents the pod's priority class. + type: string resources: description: Compute Resources required by container. properties: diff --git a/docs/crd.md b/docs/crd.md index 3564baff9..1c4844610 100644 --- a/docs/crd.md +++ b/docs/crd.md @@ -159,6 +159,7 @@ FluentBitSpec defines the desired state of FluentBit | fluentBitConfigName | Fluentbitconfig object associated with this Fluentbit | string | | secrets | The Secrets are mounted into /fluent-bit/secrets/. | []string | | runtimeClassName | The runtimeClassName represents the container runtime configuration. | string | +| priorityClassName | The priorityClassName represents the pod's priority. | string | [Back to TOC](#table-of-contents) ## Input diff --git a/manifests/setup/fluentbit-operator-crd.yaml b/manifests/setup/fluentbit-operator-crd.yaml index bd3bef905..ab9714da5 100644 --- a/manifests/setup/fluentbit-operator-crd.yaml +++ b/manifests/setup/fluentbit-operator-crd.yaml @@ -2995,6 +2995,9 @@ spec: - volumePath type: object type: object + priorityClassName: + description: PriorityClassName represents the pod's priority class. + type: string resources: description: Compute Resources required by container. properties: diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index b987e8663..e0916bffb 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -3000,6 +3000,9 @@ spec: - volumePath type: object type: object + priorityClassName: + description: PriorityClassName represents the pod's priority class. + type: string resources: description: Compute Resources required by container. properties: diff --git a/pkg/operator/daemonset.go b/pkg/operator/daemonset.go index 1cee5720f..d1d6b3ea6 100644 --- a/pkg/operator/daemonset.go +++ b/pkg/operator/daemonset.go @@ -210,6 +210,10 @@ func MakeDaemonSet(fb v1alpha2.FluentBit, logPath string) appsv1.DaemonSet { ds.Spec.Template.Spec.RuntimeClassName = &fb.Spec.RuntimeClassName } + if fb.Spec.PriorityClassName != "" { + ds.Spec.Template.Spec.PriorityClassName = fb.Spec.PriorityClassName + } + // Mount Position DB if fb.Spec.PositionDB != (corev1.VolumeSource{}) { ds.Spec.Template.Spec.Volumes = append(ds.Spec.Template.Spec.Volumes, corev1.Volume{