surahman opened a new pull request #3725:
URL: https://github.com/apache/incubator-heron/pull/3725


   ***Feature #3723: Add support for Persistent Volumes for stateful storage***
   
   **TODO:**
   
   * Kill switch with a define, `-D`, option.
   * Deeper deployment testing.
   
   >  `PersistentVolumeClaims` and mount points similar to the feature found in 
[Spark](https://spark.apache.org/docs/latest/running-on-kubernetes.html#using-kubernetes-volumes).
   
   > This will overwrite the `Volumes` and `VolumeMounts` provided in a custom 
Pod Template. This is to support on-the-fly updates to the Volumes and
   
   Added support for the following options:
   * `claimName`
   * `storageClass`
   * `sizeLimit`
   * `path`
   * `subPath`
   * `readOnly`
   
   CLI Command:
   
   `--config-property heron.kubernetes.volumes.persistentVolumeClaim.[VOLUME 
NAME].[OPTION]=[VALUE]`
   
   Example:
   Commands:
   ```bash
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.claimName=nameOfVolumeClaim
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.storageClassName=storageClassNameOfChoice
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.accessModes=comma,separated,list
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.sizeLimit=555Gi
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.volumeMode=volumeModeOfChoice
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.path=path/to/mount
   --config-property 
heron.kubernetes.volumes.persistentVolumeClaim.volumeNameOfChoice.subPath=sub/path/to/mount
   ```
   
   Will generate the PVC:
   
   ```yaml
   apiVersion: v1
   kind: PersistentVolumeClaim
   metadata:
     name: nameOfVolumeClaim
   spec:
     volumeName: volumeNameOfChoice
     accessModes:
       - comma
       - separated
       - list
     volumeMode: volumeModeOfChoice
     resources:
       requests:
         storage: 555Gi
     storageClassName: storageClassNameOfChoice
   ```
   
   With Pod Spec entries for `Volume`:
   
   ```yaml
   volumes:
     - name: volumeNameOfChoice
       persistentVolumeClaim:
         claimName: nameOfVolumeClaim
   ```
   
   With `Executor` container entries for `VolumeMounts`:
   
   ```yaml
   volumeMounts:
     - mountPath: path/to/mount
       subPath: sub/path/to/mount
       name: volumeNameOfChoice
   ```
   
   ---
   
   **DESIGN:**
   
   There is an enum in the `KubernetesConstants` class called 
`Kubernetes.PersistentVolumeClaimOptions` which containes the CLI options which 
are accepted.
   
   Parameters from the CLI are parsed into the data structure:
   `Map<String, Map<Kubernetes.PersistentVolumeClaimOptions, String>>`.
   
   Adding more options to the functionality simply requires the extension of 
the `PersistentVolumeClaimOptions` enum and adding the entries to the switch 
statement in `V1Controller.createPersistentVolumeClaims`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to