Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node selectors to job and task config #7

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Below is the list of fields in the custom resource and their description
A value between 0 and 1 that represents % of container memory dedicated to system / off heap. The
remaining memory is allocated for heap.

* **NodeSelector** `type:map[string]string`
Configuration for the node selectors used for the task manager

* **JobManagerConfig** `type:JobManagerConfig`
Configuration for the Flink job manager

Expand All @@ -52,6 +55,9 @@ Below is the list of fields in the custom resource and their description
A value between 0 and 1 that represents % of container memory dedicated to system / off heap. The
remaining memory is allocated for heap.

* **NodeSelector** `type:map[string]string`
Configuration for the node selectors used for the job manager

* **JarName** `type:string required=true`
Name of the jar file to be run. The application image needs to ensure that the jar file is present at the right location, as
the operator uses the Web API to submit jobs.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/app/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ type JobManagerConfig struct {
Environment EnvironmentConfig `json:"envConfig"`
Replicas *int32 `json:"replicas,omitempty"`
OffHeapMemoryFraction *float64 `json:"offHeapMemoryFraction,omitempty"`
NodeSelector map[string]string `json:"nodeSelector"`
annymsMthd marked this conversation as resolved.
Show resolved Hide resolved
}

type TaskManagerConfig struct {
Resources *apiv1.ResourceRequirements `json:"resources,omitempty"`
Environment EnvironmentConfig `json:"envConfig"`
TaskSlots *int32 `json:"taskSlots,omitempty"`
OffHeapMemoryFraction *float64 `json:"offHeapMemoryFraction,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}

type EnvironmentConfig struct {
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/app/v1alpha1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions pkg/controller/flink/job_manager_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func jobmanagerTemplate(app *v1alpha1.FlinkApplication) *v1.Deployment {
},
Volumes: app.Spec.Volumes,
ImagePullSecrets: app.Spec.ImagePullSecrets,
NodeSelector: app.Spec.JobManagerConfig.NodeSelector,
},
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/flink/task_manager_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ func taskmanagerTemplate(app *v1alpha1.FlinkApplication) *v1.Deployment {
},
Volumes: app.Spec.Volumes,
ImagePullSecrets: app.Spec.ImagePullSecrets,
NodeSelector: app.Spec.TaskManagerConfig.NodeSelector,
},
},
},
Expand Down