Skip to content

Commit

Permalink
Add priority class to FluentBit type (#146)
Browse files Browse the repository at this point in the history
* add priorityClassName to fluent bit spec type

Signed-off-by: Bojan <dbojan@gmail.com>

* fix comment

Signed-off-by: Bojan <dbojan@gmail.com>

* fix comment

Signed-off-by: Bojan <dbojan@gmail.com>

* fix priorityClassName API docs

Signed-off-by: Bojan <dbojan@gmail.com>
  • Loading branch information
bojand committed Oct 8, 2021
1 parent 6096845 commit 0238e88
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/fluentbitoperator/v1alpha2/fluentbit_types.go
Expand Up @@ -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
Expand Down
Expand Up @@ -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/<secret-name>.
items:
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/logging.kubesphere.io_fluentbits.yaml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions docs/crd.md
Expand Up @@ -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/<secret-name>. | []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
Expand Down
3 changes: 3 additions & 0 deletions manifests/setup/fluentbit-operator-crd.yaml
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions manifests/setup/setup.yaml
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions pkg/operator/daemonset.go
Expand Up @@ -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{
Expand Down

0 comments on commit 0238e88

Please sign in to comment.