You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by az...@apache.org on 2020/07/02 08:13:02 UTC

[flink] 02/02: [FLINK-18186][doc] Add taskmanager query state service in standalone kubernetes document

This is an automated email from the ASF dual-hosted git repository.

azagrebin pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 881c64c88f5755341c1b7821e28f9a04c7b9e009
Author: wangyang0918 <da...@alibaba-inc.com>
AuthorDate: Tue Jun 23 23:54:19 2020 +0800

    [FLINK-18186][doc] Add taskmanager query state service in standalone kubernetes document
---
 docs/ops/deployment/kubernetes.md    | 26 +++++++++++++++++++++++++-
 docs/ops/deployment/kubernetes.zh.md | 26 +++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/docs/ops/deployment/kubernetes.md b/docs/ops/deployment/kubernetes.md
index 8e8c074..1d3ee95 100644
--- a/docs/ops/deployment/kubernetes.md
+++ b/docs/ops/deployment/kubernetes.md
@@ -81,6 +81,10 @@ You can then access the Flink UI via different ways:
 
         {% highlight bash %}./bin/flink run -m <public-node-ip>:<node-port> ./examples/streaming/WordCount.jar{% endhighlight %}
 
+You can also access the queryable state of TaskManager if you create a `NodePort` service for it:
+  1. Run `kubectl create -f taskmanager-query-state-service.yaml` to create the `NodePort` service on taskmanager. The example of `taskmanager-query-state-service.yaml` can be found in [appendix](#common-cluster-resource-definitions).
+  2. Run `kubectl get svc flink-taskmanager-query-state` to know the `node-port` of this service. Then you can create the [QueryableStateClient(&lt;public-node-ip&gt;, &lt;node-port&gt;]({% link dev/stream/state/queryable_state.md %}#querying-state) to submit the state queries.
+
 In order to terminate the Flink cluster, delete the specific [Session](#deploy-session-cluster) or [Job](#deploy-job-cluster) cluster components
 and use `kubectl` to terminate the common components:
 
@@ -89,6 +93,8 @@ and use `kubectl` to terminate the common components:
     kubectl delete -f flink-configuration-configmap.yaml
     # if created then also the rest service
     kubectl delete -f jobmanager-rest-service.yaml
+    # if created then also the queryable state service
+    kubectl delete -f taskmanager-query-state-service.yaml
 ```
 
 ### Deploy Session Cluster
@@ -175,7 +181,7 @@ data:
     blob.server.port: 6124
     jobmanager.rpc.port: 6123
     taskmanager.rpc.port: 6122
-    queryable-state.server.ports: 6125
+    queryable-state.proxy.ports: 6125
     jobmanager.memory.process.size: 1600m
     taskmanager.memory.process.size: 1728m
     parallelism.default: 2
@@ -264,6 +270,24 @@ spec:
     component: jobmanager
 {% endhighlight %}
 
+`taskmanager-query-state-service.yaml`. Optional service, that exposes the TaskManager port to access the queryable state as a public Kubernetes node's port.
+{% highlight yaml %}
+apiVersion: v1
+kind: Service
+metadata:
+  name: flink-taskmanager-query-state
+spec:
+  type: NodePort
+  ports:
+  - name: query-state
+    port: 6125
+    targetPort: 6125
+    nodePort: 30025
+  selector:
+    app: flink
+    component: taskmanager
+{% endhighlight %}
+
 ### Session cluster resource definitions
 
 `jobmanager-session-deployment.yaml`
diff --git a/docs/ops/deployment/kubernetes.zh.md b/docs/ops/deployment/kubernetes.zh.md
index 189fc8a..deff204 100644
--- a/docs/ops/deployment/kubernetes.zh.md
+++ b/docs/ops/deployment/kubernetes.zh.md
@@ -81,6 +81,10 @@ You can then access the Flink UI via different ways:
 
         {% highlight bash %}./bin/flink run -m <public-node-ip>:<node-port> ./examples/streaming/WordCount.jar{% endhighlight %}
 
+You can also access the queryable state of TaskManager if you create a `NodePort` service for it:
+  1. Run `kubectl create -f taskmanager-query-state-service.yaml` to create the `NodePort` service on taskmanager. The example of `taskmanager-query-state-service.yaml` can be found in [appendix](#common-cluster-resource-definitions).
+  2. Run `kubectl get svc flink-taskmanager-query-state` to know the `node-port` of this service. Then you can create the [QueryableStateClient(&lt;public-node-ip&gt;, &lt;node-port&gt;]({% link dev/stream/state/queryable_state.zh.md %}#querying-state) to submit the state queries.
+
 In order to terminate the Flink cluster, delete the specific [Session](#deploy-session-cluster) or [Job](#deploy-job-cluster) cluster components
 and use `kubectl` to terminate the common components:
 
@@ -89,6 +93,8 @@ and use `kubectl` to terminate the common components:
     kubectl delete -f flink-configuration-configmap.yaml
     # if created then also the rest service
     kubectl delete -f jobmanager-rest-service.yaml
+    # if created then also the queryable state service
+    kubectl delete -f taskmanager-query-state-service.yaml
 ```
 
 ### Deploy Session Cluster
@@ -175,7 +181,7 @@ data:
     blob.server.port: 6124
     jobmanager.rpc.port: 6123
     taskmanager.rpc.port: 6122
-    queryable-state.server.ports: 6125
+    queryable-state.proxy.ports: 6125
     jobmanager.memory.process.size: 1600m
     taskmanager.memory.process.size: 1728m
     parallelism.default: 2
@@ -264,6 +270,24 @@ spec:
     component: jobmanager
 {% endhighlight %}
 
+`taskmanager-query-state-service.yaml`. Optional service, that exposes the TaskManager port to access the queryable state as a public Kubernetes node's port.
+{% highlight yaml %}
+apiVersion: v1
+kind: Service
+metadata:
+  name: flink-taskmanager-query-state
+spec:
+  type: NodePort
+  ports:
+  - name: query-state
+    port: 6125
+    targetPort: 6125
+    nodePort: 30025
+  selector:
+    app: flink
+    component: taskmanager
+{% endhighlight %}
+
 ### Session cluster resource definitions
 
 `jobmanager-session-deployment.yaml`