This is an automated email from the ASF dual-hosted git repository.
gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 32080aa [FLINK-26661] Add pod template doc
32080aa is described below
commit 32080aade6808fb149495b93815f7b81bc37ff98
Author: Thomas Weise <[email protected]>
AuthorDate: Wed Mar 23 19:52:27 2022 -0700
[FLINK-26661] Add pod template doc
---
docs/README.md | 28 ++++----
docs/content/docs/custom-resource/pod-template.md | 80 +++++++++++++++++++++++
2 files changed, 95 insertions(+), 13 deletions(-)
diff --git a/docs/README.md b/docs/README.md
index 3525861..c5419e9 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -8,19 +8,21 @@ that you always have docs corresponding to your checked-out
version.
### Build the site locally
-Make sure you have installed
-[Hugo](https://gohugo.io/getting-started/installing/) on your system.
-
-From this directory:
-
- * Fetch the theme submodule
- ```sh
- git submodule update --init --recursive
- ```
- * Start local server
- ```sh
- hugo -b "" serve
- ```
+#### Using Hugo Docker image:
+
+```sh
+$ git submodule update --init --recursive
+$ docker run -v $(pwd):/src -p 1313:1313 jakejarvis/hugo-extended:latest
server --buildDrafts --buildFuture --bind 0.0.0.0
+```
+
+#### Local Hugo installation:
+
+Make sure you have installed
[Hugo](https://gohugo.io/getting-started/installing/) on your system.
+
+```sh
+$ git submodule update --init --recursive
+$ hugo -b "" serve
+```
The site can be viewed at http://localhost:1313/
diff --git a/docs/content/docs/custom-resource/pod-template.md
b/docs/content/docs/custom-resource/pod-template.md
index e8784b0..34949fa 100644
--- a/docs/content/docs/custom-resource/pod-template.md
+++ b/docs/content/docs/custom-resource/pod-template.md
@@ -25,3 +25,83 @@ under the License.
-->
# Pod template
+
+The operator CRD is designed to have a minimal set of direct, short-hand CRD
settings to express the most
+basic attributes of a deployment. For all other settings the CRD provides the
`flinkConfiguration` and
+`podTemplate` fields.
+
+Pod templates permit customization of the Flink job and task manager pods, for
example to specify
+volume mounts, ephemeral storage, sidecar containers etc.
+
+Pod templates can be layered, as shown in the example below.
+A common pod template may hold the settings that apply to both job and task
manager,
+like `volumeMounts`. Another template under job or task manager can define
additional settings that supplement or override those
+in the common template, such as a task manager sidecar.
+
+The operator is going to merge the common and specific templates for job and
task manager respectively.
+
+Here the full example:
+
+```yaml
+apiVersion: flink.apache.org/v1alpha1
+kind: FlinkDeployment
+metadata:
+ namespace: default
+ name: pod-template-example
+spec:
+ image: flink:1.14.3
+ flinkVersion: v1_14
+ flinkConfiguration:
+ taskmanager.numberOfTaskSlots: "2"
+ podTemplate:
+ apiVersion: v1
+ kind: Pod
+ metadata:
+ name: pod-template
+ spec:
+ serviceAccount: flink
+ containers:
+ # Do not change the main container name
+ - name: flink-main-container
+ volumeMounts:
+ - mountPath: /opt/flink/log
+ name: flink-logs
+ # Sample sidecar container
+ - name: fluentbit
+ image: fluent/fluent-bit:1.8.12-debug
+ command: [ 'sh','-c','/fluent-bit/bin/fluent-bit -i tail -p
path=/flink-logs/*.log -p multiline.parser=java -o stdout' ]
+ volumeMounts:
+ - mountPath: /flink-logs
+ name: flink-logs
+ volumes:
+ - name: flink-logs
+ emptyDir: { }
+ jobManager:
+ replicas: 1
+ resource:
+ memory: "2048m"
+ cpu: 1
+ taskManager:
+ resource:
+ memory: "2048m"
+ cpu: 1
+ podTemplate:
+ apiVersion: v1
+ kind: Pod
+ metadata:
+ name: task-manager-pod-template
+ spec:
+ initContainers:
+ # Sample sidecar container
+ - name: busybox
+ image: busybox:latest
+ command: [ 'sh','-c','echo hello from task manager' ]
+ job:
+ jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
+ parallelism: 2
+```
+
+{{< hint info >}}
+When using the operator with Flink native Kubernetes integration, please refer
to [pod template field precedence](
+https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/deployment/resource-providers/native_kubernetes/#fields-overwritten-by-flink).
+{{< /hint >}}