flink

by Helm

Helm chartv0.2.0App 1.11.2

Chart for Apache Flink

About this chart

Apache Flink Helm Chart

This is an implementation of https://ci.apache.org/projects/flink/flink-docs-stable/ops/deployment/kubernetes.html

This chart will install session cluster https://ci.apache.org/projects/flink/flink-docs-stable/ops/deployment/kubernetes.html#flink-session-cluster-on-kubernetes. If you are interested in supporting session/job clusters: https://github.com/GoogleCloudPlatform/flink-on-k8s-operator

Pre Requisites:

  • Kubernetes 1.3 with alpha APIs enabled and support for storage classes

  • PV support on underlying infrastructure

  • Requires at least v2.0.0-beta.1 version of helm to support dependency management with requirements.yaml

StatefulSet Details

  • https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/

StatefulSet Caveats

  • https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations

Chart Details

This chart will do the following:

  • Implement a dynamically scalable Flink(Jobmanagers and Taskmanagers) cluster using Kubernetes StatefulSets

  • Implement a dynamically scalable zookeeper cluster as another Kubernetes StatefulSet required for the Flink cluster above

Installing the Chart

To install the chart with the release name my-flink in the default namespace:

$ helm repo add riskfocus https://riskfocus.github.io/helm-charts-public
$ helm repo update
$ helm install --name my-flink riskfocus/flink

If using a dedicated namespace(recommended) then make sure the namespace exists with:

$ helm repo add riskfocus https://riskfocus.github.io/helm-charts-public
$ helm repo update
$ helm install --name my-flink --namespace flink riskfocus/flink

This chart can includes a ZooKeeper chart as a dependency to the Flink cluster Jobmanagers HA mode in its requirement.yaml. The chart can be customized using the following configurable parameters(other parameters can be found in values.yaml):

ParameterDescriptionDefault
image.repositoryFlink Container image nameflink
image.tagFlink Container image tag1.11.2-scala_2.12
image.PullPolicyFlink Containers pull policyIfNotPresent
flink.monitoring.enabledEnables Flink monitoringtrue
jobmanager.highAvailability.enabledEnables Jobmanager HA mode keyfalse
jobmanager.highAvailability.storageDirstorageDir for Jobmanager in HA modenull
jobmanager.replicaCountJobmanagers count context1
jobmanager.heapSizeJobmanager HeapSize options1g
jobmanager.resourcesJobmanager resources{}
taskmanager.resourcesTaskmanager Resources key{}
taskmanager.heapSizeTaskmanager heapSize mode1g
jobmanager.replicaCountTaskmanager count context1
taskmanager.numberOfTaskSlotsNumber of Taskmanager taskSlots resources1
taskmanager.resourcesTaskmanager resources{}
zookeeper.enabledIf True, installs Zookeeper Chartfalse
zookeeper.resourcesZookeeper resource requests and limits{}
zookeeper.envEnvironmental variables provided to Zookeeper Zookeeper{ZK_HEAP_SIZE: "1G"}
zookeeper.storageZookeeper Persistent volume size2Gi
zookeeper.image.PullPolicyZookeeper Container pull policyIfNotPresent
zookeeper.urlURL of Zookeeper Cluster (unneeded if installing Zookeeper Chart)""
zookeeper.portPort of Zookeeper Cluster2181
zookeeper.affinityDefines affinities and anti-affinities for pods as defined in: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity preferences{}
zookeeper.nodeSelectorNode labels for pod assignment{}
secrets.bitnamiSealedSecrets.enabledEnables creation of Sealed Secretsfalse

Install with HA

You can install this chart with enabled HA based on Zookeeper by provided follow parameters:

$ helm install --name my-flink riskfoucs/flink --set \
zookeeper.enabled=true,jobmanager.replicaCount=2,jobmanager.highAvailability.enabled=true,jobmanager.highAvailability.storageDir=s3://MY_BUCKET/flink/jobmanager
  • storageDir can be different for your installation, see https://ci.apache.org/projects/flink/flink-docs-stable/ops/config.html#high-availability-storagedir

Deploy flink with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has flink on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartflink is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply