Skip to content

Commit

Permalink
Added doc on mounting volumes (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchaoran2011 authored and anandswaminathan committed Jun 12, 2019
1 parent d9dd430 commit 2e53557
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ spec:
listKind: FlinkApplicationList
plural: flinkapplications
singular: flinkapplication
shortNames:
- flinkapp

scope: Namespaced
version: v1alpha1
Expand Down
26 changes: 21 additions & 5 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,40 @@ 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 <YAML file path>` 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 <YAML file path>` 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 <name>` 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 <name>` 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 <updated YAML file>` 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 <updated YAML file>` 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

A `FlinkApplication` can be checked using the `kubectl describe flinkapplication.flink.k8s.io <name>` command. The output of the command shows the specification and status of the `FlinkApplication` as well as events associated with it.

## 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.

0 comments on commit 2e53557

Please sign in to comment.