diff --git a/deploy/crd.yaml b/deploy/crd.yaml index 4f60dbf4..acd245e9 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -9,6 +9,8 @@ spec: listKind: FlinkApplicationList plural: flinkapplications singular: flinkapplication + shortNames: + - flinkapp scope: Namespaced version: v1alpha1 diff --git a/docs/user_guide.md b/docs/user_guide.md index e56bbc2b..1a8ded18 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -5,19 +5,35 @@ For a quick introduction on how to build and install the Kubernetes Operator for ## Working with FlinkApplications ### Building a new Flink application -The flink operator brings up Jobmanager and Taskmanager for an application in Kubernetes. It does this by creating [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) objects based on the *image* field in the flink application custom resource object. For more information about building images, please refer to this [documentation](/examples/README.md) and [examples](/examples/wordcount/) +The Flink operator brings up Jobmanager and Taskmanager for an application in Kubernetes. It does this by creating [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) objects based on the *image* field in the FlinkApplication custom resource object. For more information about building images, please refer to this [documentation](/examples/README.md) and [examples](/examples/wordcount/). ### Creating a New FlinkApplication -A `FlinkApplication` can be created from a YAML file storing the `FlinkApplication` specification using either the `kubectl apply -f ` command. Once a `FlinkApplication` is successfully created, the operator will receive it and creates a flink cluster as configured in the specification to run on the Kubernetes cluster. +A `FlinkApplication` can be created from a YAML file storing the `FlinkApplication` specification using either the `kubectl apply -f ` command. Once a `FlinkApplication` is successfully created, the operator will receive it and creates a Flink cluster as configured in the specification to run on the Kubernetes cluster. + +#### Mounting Volumes in the Flink Pods + +The Flink operator supports mounting user-defined [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) in the Flink job manager and task manager pods. The volume can be of various types (e.g. configMap, secret, hostPath and persistentVolumeClaim). To specify the volume to be mounted, in the FlinkApp YAML, include `volumes` and `volumeMounts` under `spec`. + +For example, the following YAML specifies a volume named `config-vol` populated by a ConfigMap named `dummy-cm`. The volume `config-vol` will be mounted at path `/opt/flink/mycm` in the job manager and task manager pods. + +```yaml +volumes: + - name: config-vol + configMap: + name: dummy-cm +volumeMounts: + - name: config-vol + mountPath: /opt/flink/mycm +``` ### Deleting a FlinkApplication -A `FlinkApplication` can be deleted using either the `kubectl delete ` command. Deleting a `Flinkapplication` deletes the Flink application custom resource and flink cluster associated with it. If the flink job is running when the deletion happens, the flink job is cancelled with savepoint before the cluster is deleted. +A `FlinkApplication` can be deleted using either the `kubectl delete ` command. Deleting a `Flinkapplication` deletes the Flink application custom resource and Flink cluster associated with it. If the Flink job is running when the deletion happens, the Flink job is cancelled with savepoint before the cluster is deleted. ### Updating an existing FlinkApplication -A `FlinkApplication` can be updated using the `kubectl apply -f ` command. When a `FlinkApplication` is successfully updated, the operator observes that the resource has changed. The operator before deleting the existing deployment, will cancel the flink job with savepoint. After the savepoint succeeds, the operator deletes the existing deployment and submits a new flink job from the savepoint in the new flink cluster. +A `FlinkApplication` can be updated using the `kubectl apply -f ` command. When a `FlinkApplication` is successfully updated, the operator observes that the resource has changed. The operator before deleting the existing deployment, will cancel the Flink job with savepoint. After the savepoint succeeds, the operator deletes the existing deployment and submits a new Flink job from the savepoint in the new Flink cluster. ### Checking a FlinkApplication @@ -25,4 +41,4 @@ A `FlinkApplication` can be checked using the `kubectl describe flinkapplication ## Customizing the flink operator -To customize the flink operator, set/update these [configurations](https://github.com/lyft/flinkk8soperator/blob/master/pkg/controller/config/config.go). The values for config can be set either through [configmap](/deploy/config.yaml) or through command line. +To customize the Flink operator, set/update these [configurations](https://github.com/lyft/flinkk8soperator/blob/master/pkg/controller/config/config.go). The values for config can be set either through a [ConfigMap](/deploy/config.yaml) or through command line.