Skip to content

Commit

Permalink
Merge branch 'master' into feature/takeover_parametercontext
Browse files Browse the repository at this point in the history
  • Loading branch information
juldrixx authored May 18, 2022
2 parents 47da97c + 68ef998 commit 4fc7797
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- [PR #76](https://github.com/konpyutaika/nifikop/pull/76) - **[Operator/NiFiCluster]** Add ability to override default authorizers.xml template.
- [PR #95](https://github.com/konpyutaika/nifikop/pull/95) - **[Operator/NiFiParameterContext]** Allow the operator to take over existing parameter context.
- [PR #96](https://github.com/konpyutaika/nifikop/pull/96) - **[Operator/NifiCluster]** Add ability to specify pod priority class

### Changed

Expand Down
11 changes: 11 additions & 0 deletions api/v1alpha1/nificluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ type NodeConfig struct {
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// podMetadata allows to add additionnal metadata to the node pods
PodMetadata Metadata `json:"podMetadata,omitempty"`
// priorityClassName can be used to set the priority class applied to the node
// +optional
PriorityClassName *string `json:"priorityClassName,omitempty"`
}

type Metadata struct {
Expand Down Expand Up @@ -655,6 +658,14 @@ func (nConfig *NodeConfig) GetResources() *corev1.ResourceRequirements {
}
}

// GetPriorityClass returns the name of the priority class to use for the given node
func (nConfig *NodeConfig) GetPriorityClass() string {
if nConfig.PriorityClassName != nil {
return *nConfig.PriorityClassName
}
return ""
}

//
func (nConfig *NodeConfig) GetRunAsUser() *int64 {
var defaultUserID int64 = 1000
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

8 changes: 8 additions & 0 deletions config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3427,6 +3427,10 @@ spec:
associated https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
type: object
type: object
priorityClassName:
description: priorityClassName can be used to set the priority
class applied to the node
type: string
provenanceStorage:
description: provenanceStorage allow to specify the maximum
amount of data provenance information to store at a time https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#write-ahead-provenance-repository-properties
Expand Down Expand Up @@ -5670,6 +5674,10 @@ spec:
associated https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
type: object
type: object
priorityClassName:
description: priorityClassName can be used to set the priority
class applied to the node
type: string
provenanceStorage:
description: provenanceStorage allow to specify the maximum
amount of data provenance information to store at a time
Expand Down
8 changes: 8 additions & 0 deletions helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3427,6 +3427,10 @@ spec:
associated https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
type: object
type: object
priorityClassName:
description: priorityClassName can be used to set the priority
class applied to the node
type: string
provenanceStorage:
description: provenanceStorage allow to specify the maximum
amount of data provenance information to store at a time https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#write-ahead-provenance-repository-properties
Expand Down Expand Up @@ -5670,6 +5674,10 @@ spec:
associated https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
type: object
type: object
priorityClassName:
description: priorityClassName can be used to set the priority
class applied to the node
type: string
provenanceStorage:
description: provenanceStorage allow to specify the maximum
amount of data provenance information to store at a time
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/nifi/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ done`,
DNSPolicy: corev1.DNSClusterFirst,
ImagePullSecrets: nodeConfig.GetImagePullSecrets(),
ServiceAccountName: nodeConfig.GetServiceAccount(),
Priority: util.Int32Pointer(0),
PriorityClassName: nodeConfig.GetPriorityClass(),
SchedulerName: "default-scheduler",
Tolerations: nodeConfig.GetTolerations(),
NodeSelector: nodeConfig.GetNodeSelector(),
Expand Down
3 changes: 3 additions & 0 deletions site/docs/5_references/1_nifi_cluster/3_node_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ NodeConfig defines the node configuration
# nodeAffinity:
# imagePullPolicy define the pull policy for NiFi cluster docker image
imagePullPolicy: IfNotPresent
# priorityClassName define the name of the priority class to be applied to these nodes
priorityClassName: "example-priority-class-name"
# externalVolumeConfigs specifies a list of volume to mount into the main container.
externalVolumeConfigs:
- name: example-volume
Expand Down Expand Up @@ -82,6 +84,7 @@ NodeConfig defines the node configuration
| nodeSelector | map\[string\]string |nodeSelector can be specified, which set the pod to fit on a node [nodeselector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector)|No|nil|
| tolerations | \[ \][Toleration](https://godoc.org/k8s.io/api/core/v1#Toleration) |tolerations can be specified, which set the pod's tolerations [taint-and-toleration](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/#concepts).|No|nil|
| podMetadata | [Metadata](#metadata) |define additionnal metadata to merge to the pod associated.|No|nil|
| priorityClassName | string | Specify the name of the priority class to apply to pods created with this node config | No | nil|
## StorageConfig
Expand Down

0 comments on commit 4fc7797

Please sign in to comment.