Skip to content

Commit

Permalink
Add node selectors to job and task config
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <joshuabnjmn@gmail.com>
  • Loading branch information
annymsMthd committed Jun 3, 2019
1 parent 5aa8a13 commit a5e5f36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
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"`
}

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"`
}

type EnvironmentConfig struct {
Expand Down
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

0 comments on commit a5e5f36

Please sign in to comment.