Deployment templates are specified as part of Deployment under
spec.template and configure the Apache Flink® job to execute, including Flink cluster-level configuration as well as Flink job-specific configuration.
The relationship between the overall Deployment specification and its Deployment template is as follows:
- The Deployment template specifies which Apache Flink® job is executed and how to execute it, including its configuration.
- The Deployment specification defines how job instances are managed over time, for instance how to perform upgrades or which Savepoint to restore from.
On a high-level, each Deployment template consists of two parts:
- Optional annotations used to provide additional configuration options, used to enable additional features.
- The spec specifies which Flink job to execute and how to configure it.
The main part of a Deployment template is its spec which is described in the following sections. At the end of this page you will find a full example.
Application Mode vs. Session Mode¶
The Deployment template specifies both Flink cluster-level configuration as well as Flink job-specific configuration.
In application mode, the Deployment will be executed in a separate Flink cluster and all template attributes are available for configuration.
In session mode, the Deployment will be executed in a shared Flink cluster and some template attribute have to be omitted. The cluster-level configuration happens as part of the SessionCluster resource referenced by the Deployment. Therefore, cluster-level configuration must be ommitted from the Deployment template.
The following table summarizes the available attributes and whether they can be specified in the respective Deployment mode.
|Attribute||See Also||Application Mode||Session Mode|
||Kubernetes Pod Templates||✓||!|
- ✓ indicates that the attribute can be configured as part of the Deployment Template.
- ! indicates that the attribute cannot be configured as part of the Deployment Template. In this case, the attribute affects the Flink cluster and should be configured as part of the SessionCluster referenced by the Deployment.