[ 
https://issues.apache.org/jira/browse/FLINK-29110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17597006#comment-17597006
 ] 

Gyula Fora commented on FLINK-29110:
------------------------------------

+1 from my side, seems there are many potential benefits without downsides. 
[~kevin_123] would you like to also work on this ticket?

In any case we should try to finish this before 1.2.0 (end of september) as 
that will be the first release supporting standalone deployment mode

> Support to mount a dynamically-created pvc for JM and TM in standalone mode 
> with StatefulSet.
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLINK-29110
>                 URL: https://issues.apache.org/jira/browse/FLINK-29110
>             Project: Flink
>          Issue Type: Improvement
>          Components: Kubernetes Operator
>            Reporter: Peng Yuan
>            Priority: Major
>
> Use StatefulSet instead of Deployment to deploy JM and TM to support mount a 
> dynamically-created PersistentVolumeClaim.
> add volumeClaimTemplates to JobManagerSpec and TaskManagerSpec:
> JobManagerSpec:
> {code:java}
> public class JobManagerSpec {
>     /** Resource specification for the JobManager pods. */
>     private Resource resource;
>     /** Number of JobManager replicas. Must be 1 for non-HA deployments. */
>     private int replicas = 1;
>     /** Volume Claim Templates for JobManager stateful set. Just for 
> standalone mode. */
>     private List<PersistentVolumeClaim> volumeClaimTemplates = new 
> ArrayList<>();
>     /** JobManager pod template. It will be merged with 
> FlinkDeploymentSpec.podTemplate. */
>     private Pod podTemplate;
> }
>  {code}
> TaskManagerSpec:
> {code:java}
> public class TaskManagerSpec {
>     /** Resource specification for the TaskManager pods. */
>     private Resource resource;
>     /** Number of TaskManager replicas. If defined, takes precedence over 
> parallelism */
>     @SpecReplicas private Integer replicas;
>     /** Volume Claim Templates for TaskManager stateful set. Just for 
> standalone mode. */
>     private List<PersistentVolumeClaim> volumeClaimTemplates = new 
> ArrayList<>();
>     /** TaskManager pod template. It will be merged with 
> FlinkDeploymentSpec.podTemplate. */
>     private Pod podTemplate;
> } {code}
>  
> volumeClaimTemplates just available in standalone mode.
> CR Example:
> {code:java}
> kind: FlinkDeployment
> metadata:
>   namespace: default
>   name: basic-example
> spec:
>   image: flink:1.14.3
>   flinkVersion: v1_14
>   flinkConfiguration:
>     taskmanager.numberOfTaskSlots: "2"
>   serviceAccount: flink
>   jobManager:
>     replicas: 1
>     resource:
>       memory: "2048m"
>       cpu: 1
>     volumeClaimTemplates:
>       - metadata:
>           name: log
>         spec:
>           accessModes: [ "ReadWriteOnce" ]
>           storageClassName: "alicloud-local-lvm"
>           resources:
>             requests:
>               storage: 10Gi
>     podTemplate:
>       apiVersion: v1
>       kind: Pod
>       metadata:
>         name: job-manager-pod-template
>       spec:
>         containers:
>           - name: flink-main-container
>             volumeMounts:
>               - name: log
>                 mountPath: /opt/flink/log
>   taskManager:
>     replicas: 1 // (only needed for standalone clusters)*     
>     resource:
>       memory: "2048m"
>       cpu: 1
>     volumeClaimTemplates: 
>       - metadata:
>           name: log
>         spec:
>           accessModes: [ "ReadWriteOnce" ]
>           storageClassName: "alicloud-local-lvm"
>           resources:
>             requests:
>               storage: 10Gi
>     podTemplate:
>       apiVersion: v1
>       kind: Pod
>       metadata:
>         name: task-manager-pod-template
>       spec:
>         containers:
>           - name: flink-main-container
>             volumeMounts:
>               - name: log
>                 mountPath: /opt/flink/log
>   mode: standalone {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to