diff --git a/docs/layouts/shortcodes/generated/kubernetes_config_configuration.html b/docs/layouts/shortcodes/generated/kubernetes_config_configuration.html
index 0b544e50fdb0dd..9a9fa4064d0cdc 100644
--- a/docs/layouts/shortcodes/generated/kubernetes_config_configuration.html
+++ b/docs/layouts/shortcodes/generated/kubernetes_config_configuration.html
@@ -152,6 +152,12 @@
Integer |
Specify how many JobManager pods will be started simultaneously. Configure the value to greater than 1 to start standby JobManagers. It will help to achieve faster recovery. Notice that high availability should be enabled when starting standby JobManagers. |
+
+ kubernetes.jobmanager.scheduler-name |
+ "default-scheduler" |
+ String |
+ Specify the kubernetes pod scheduler for jobmanager pods of deployment. The default value is using the kubernetes default pod scheduler. For customerized kubernetes pod scheduler, allow to set pod scheduler for customerized pod scheduling. If not explicitly configured, config option 'kubernetes.scheduler-name' will be used. |
+
kubernetes.jobmanager.service-account |
"default" |
@@ -206,6 +212,12 @@
Enum |
The exposed type of the rest service. The exposed rest service could be used to access the Flinkās Web UI and REST endpoint.
Possible values:- "ClusterIP"
- "NodePort"
- "LoadBalancer"
- "Headless_ClusterIP"
|
+
+ kubernetes.scheduler-name |
+ "default-scheduler" |
+ String |
+ Specify the kubernetes pod scheduler for Flink pods of deployment. The default value is using the kubernetes default pod scheduler. For customerized kubernetes pod scheduler, allow to set pod scheduler for customerized pod scheduling. Notice that this can be overwritten by config options 'kubernetes.jobmanager.scheduler-name' and 'kubernetes.taskmanager.scheduler-name' for jobmanager and taskmanager respectively. |
+
kubernetes.secrets |
(none) |
@@ -260,6 +272,12 @@
Map |
The node selector to be set for TaskManager pods. Specified as key:value pairs separated by commas. For example, environment:production,disk:ssd. |
+
+ kubernetes.taskmanager.scheduler-name |
+ "default-scheduler" |
+ String |
+ Specify the kubernetes pod scheduler for taskmanager pods of deployment. The default value is using the kubernetes default pod scheduler. For customerized kubernetes pod scheduler, allow to set pod scheduler for customerized pod scheduling. If not explicitly configured, config option 'kubernetes.scheduler-name' will be used. |
+
kubernetes.taskmanager.service-account |
"default" |
diff --git a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
index 15da84f71d37ff..8c72d1c64fe3be 100644
--- a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
+++ b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
@@ -49,6 +49,7 @@ public class KubernetesConfigOptions {
private static final String KUBERNETES_SERVICE_ACCOUNT_KEY = "kubernetes.service-account";
private static final String KUBERNETES_POD_TEMPLATE_FILE_KEY = "kubernetes.pod-template-file";
+ private static final String KUBERNETES_POD_SCHEDULER_NAME_KEY = "kubernetes.scheduler-name";
public static final ConfigOption CONTEXT =
key("kubernetes.context")
@@ -444,6 +445,46 @@ public class KubernetesConfigOptions {
public static final ConfigOption TASK_MANAGER_POD_TEMPLATE;
+ public static final ConfigOption JOB_MANAGER_POD_SCHEDULER_NAME =
+ key("kubernetes.jobmanager.scheduler-name")
+ .stringType()
+ .defaultValue("default-scheduler")
+ .withFallbackKeys(KUBERNETES_POD_SCHEDULER_NAME_KEY)
+ .withDescription(
+ "Specify the kubernetes pod scheduler for jobmanager pods of deployment. "
+ + "The default value is using the kubernetes default pod scheduler. "
+ + "For customerized kubernetes pod scheduler, allow to set pod scheduler "
+ + "for customerized pod scheduling. If not explicitly configured, config option '"
+ + KUBERNETES_POD_SCHEDULER_NAME_KEY
+ + "' will be used.");
+
+ public static final ConfigOption TASK_MANAGER_POD_SCHEDULER_NAME =
+ key("kubernetes.taskmanager.scheduler-name")
+ .stringType()
+ .defaultValue("default-scheduler")
+ .withFallbackKeys(KUBERNETES_POD_SCHEDULER_NAME_KEY)
+ .withDescription(
+ "Specify the kubernetes pod scheduler for taskmanager pods of deployment. "
+ + "The default value is using the kubernetes default pod scheduler. "
+ + "For customerized kubernetes pod scheduler, allow to set pod scheduler "
+ + "for customerized pod scheduling. If not explicitly configured, config option '"
+ + KUBERNETES_POD_SCHEDULER_NAME_KEY
+ + "' will be used.");
+
+ public static final ConfigOption POD_SCHEDULER_NAME =
+ key(KUBERNETES_POD_SCHEDULER_NAME_KEY)
+ .stringType()
+ .defaultValue("default-scheduler")
+ .withDescription(
+ "Specify the kubernetes pod scheduler for Flink pods of deployment. "
+ + "The default value is using the kubernetes default pod scheduler. "
+ + "For customerized kubernetes pod scheduler, allow to set pod scheduler "
+ + "for customerized pod scheduling. Notice that this can be overwritten by config options '"
+ + JOB_MANAGER_POD_SCHEDULER_NAME.key()
+ + "' and '"
+ + TASK_MANAGER_POD_SCHEDULER_NAME.key()
+ + "' for jobmanager and taskmanager respectively.");
+
/**
* This option is here only for documentation generation, it is the fallback key of
* JOB_MANAGER_POD_TEMPLATE and TASK_MANAGER_POD_TEMPLATE.
diff --git a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java
index 90318554f98071..0c85c2636a3058 100644
--- a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java
+++ b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java
@@ -102,6 +102,7 @@ public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
kubernetesJobManagerParameters.getTolerations().stream()
.map(e -> KubernetesToleration.fromMap(e).getInternalResource())
.collect(Collectors.toList()))
+ .withSchedulerName(kubernetesJobManagerParameters.getPodSchedulerName())
.endSpec();
final Container basicMainContainer = decorateMainContainer(flinkPod.getMainContainer());
diff --git a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitTaskManagerDecorator.java b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitTaskManagerDecorator.java
index 2218505445aad5..b40d2e47ef4de1 100644
--- a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitTaskManagerDecorator.java
+++ b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitTaskManagerDecorator.java
@@ -95,6 +95,7 @@ public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
kubernetesTaskManagerParameters.isHostNetworkEnabled()
? DNS_PLOICY_HOSTNETWORK
: DNS_PLOICY_DEFAULT)
+ .withSchedulerName(kubernetesTaskManagerParameters.getPodSchedulerName())
.endSpec();
// Merge fields
diff --git a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/AbstractKubernetesParameters.java b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/AbstractKubernetesParameters.java
index c9bd7ef0397d19..43b8e087a2f162 100644
--- a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/AbstractKubernetesParameters.java
+++ b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/AbstractKubernetesParameters.java
@@ -206,4 +206,9 @@ public List