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

mbalassi 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 792350e8 [FLINK-28223] Add artifact-fetcher to the pod-template.yaml 
example
792350e8 is described below

commit 792350e8722a3cbe9b32b5bd65983a5e14541933
Author: ConradJam <[email protected]>
AuthorDate: Thu Jul 21 16:27:27 2022 +0200

    [FLINK-28223] Add artifact-fetcher to the pod-template.yaml example
    
    Closes #308.
---
 examples/pod-template.yaml | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/examples/pod-template.yaml b/examples/pod-template.yaml
index b749b3e1..61431fa7 100644
--- a/examples/pod-template.yaml
+++ b/examples/pod-template.yaml
@@ -38,9 +38,11 @@ spec:
           volumeMounts:
             - mountPath: /opt/flink/log
               name: flink-logs
-        # Sample sidecar container
+            - mountPath: /opt/flink/downloads
+              name: downloads
+        # Sample sidecar container for log forwarding
         - name: fluentbit
-          image: fluent/fluent-bit:1.8.12-debug
+          image: fluent/fluent-bit:1.9.6-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
@@ -48,14 +50,12 @@ spec:
       volumes:
         - name: flink-logs
           emptyDir: { }
+        - name: downloads
+          emptyDir: { }
   jobManager:
     resource:
       memory: "2048m"
       cpu: 1
-  taskManager:
-    resource:
-      memory: "2048m"
-      cpu: 1
     podTemplate:
       apiVersion: v1
       kind: Pod
@@ -63,10 +63,22 @@ spec:
         name: task-manager-pod-template
       spec:
         initContainers:
-          # Sample sidecar container
+          # Sample init container for fetching remote artifacts
           - name: busybox
             image: busybox:latest
-            command: [ 'sh','-c','echo hello from task manager' ]
+            volumeMounts:
+              - mountPath: /opt/flink/downloads
+                name: downloads
+            command:
+            - /bin/sh
+            - -c
+            - "wget -O /opt/flink/downloads/flink-examples-streaming.jar \
+              
https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming_2.12/1.15.1/flink-examples-streaming_2.12-1.15.1.jar";
+  taskManager:
+    resource:
+      memory: "2048m"
+      cpu: 1
   job:
-    jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
+    jarURI: local:///opt/flink/downloads/flink-examples-streaming.jar
+    entryClass: 
org.apache.flink.streaming.examples.statemachine.StateMachineExample
     parallelism: 2

Reply via email to