<p>The Flink official documentation provides a <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.6/ops/jobmanager_high_availability.html" rel="nofollow noreferrer">jobmanager high availability</a> solution for Standalone And Yarn Flink clusters. But what should be done for high availability using a Kubernetes Flink Cluster?</p>

<p>From the <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.5/ops/deployment/kubernetes.html" rel="nofollow noreferrer">Kubernetes Setup</a> section of the document, it seems we just deploy a single Jobmanager when deploying to a Kubernetes cluster. So how to achieve HA for a Kubernetes Flink Cluster?</p>

<p>The <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.6/ops/jobmanager_high_availability.html" rel="nofollow noreferrer">official doc says</a> that high availability for the job manager is to deal with cases where the job manager crashes. So there is only a single job manager needed but you want to handle the case where it goes down. On Kubernetes if it goes down then Kubernetes should detect this and automatically restart it. So you don't need to run more replicas of it. </p>

<p>(The doc says this <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.6/ops/jobmanager_high_availability.html#yarn-cluster-high-availability" rel="nofollow noreferrer">explicitly about using yarn for ha</a>. It doesn't seem to <em>state</em> it for Kubernetes but restarting failing Pods is <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" rel="nofollow noreferrer">standard behaviour for Kubernetes</a>.)</p>

<p>The task manager is configured by default to run with multiple replicas on Kubernetes in the official k8s resources (see the 'replicas' entries <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.5/ops/deployment/kubernetes.html#simple-kubernetes-flink-cluster-resources" rel="nofollow noreferrer">in the resources</a>) but the job manager is not. (And it's the <a href="https://github.com/docker-flink/examples/tree/master/helm/flink/templates" rel="nofollow noreferrer">same in the helm chart</a>.) So I believe it is not needed for the job manager - I'd suggest running with a single job-manager unless you hit specific problems with that. </p>
