Kubernetes HA master setup - kubernetes

I have configured two separate masters in Kubernetes in Google Cloud..How to connect both masters for high availabilty Mater(for resiliency)? Anyone can help?
Reagrds,
Rishabh

If you are planning to use multi master in Kubernetes, you need to use load balancer for high availability.
Please check the official document for detailed steps.
https://kubernetes.io/docs/admin/high-availability/

Related

How to create a multi-master cluster in Azure

I need to create an Azure Kubernetes Service with 3 master nodes. So far I used to work with single master cluster, now I am in need of creating a multi-master cluster for production environments.
Can I get a way to create an AKS with multiple control planes. Thanks in Advance.
As Soundarya mentioned in the comment, the solution could be fould here:
As your ask is on AKS (Managed service from Azure) with HA enabled Clusters you already have more than one master running. As AKS is a managed offering service you will will not have the visibility/control on this.
Can I get a way to create an AKS with multiple control planes?
For this you can check the AKS Uptime SLA, Uptime SLA guarantees 99.95% availability of the Kubernetes API server endpoint for clusters.
Please check this document for more details.
If you are using AKS Engine (unmanaged service), then you can specify the number of masters. Please refer to this document for more details.

Prometheus HA in Kubernetes (AKS)

I'm running the following helm chart (https://github.com/helm/charts/tree/master/stable/prometheus) with server.replicaCount =2 and server.statefulSet.enabled = true.
For storage i use two Manage Disks (not Azure Files that is not POSIX) (2 PV and 2 PVC) are created during the deployment of the chart.
My question is:
Is this an HA solution? Are the metrics written to both prometheus instances (a service with a public ip and and headless "service" are created) and replicated to both disks?
How this replicas really work?
Thanks,
Sadly, as Piotr noted, this is not a true HA offering and Thanos is generally the preferred way to go for this kind of setup, but not without it's own gotchas. The amount of clusters you have is a factor, and you might need some sort of tooling account to be able to follow changes all the way through.
What I can offer you is this excellent talk, which includes a live demo and shows how this works in practice.
No, this is not HA solution. This only scales the deployment to have 2 replicas at all times which both are on statefulsets.
In order to achieve HA monitoring on Kuberetes there needs to be dynamic failure detection and routing tools involved.
There are couple of articles about getting prometheus work with HA:
Deploying an HA Prometheus in Kubernetes on AWS — Multiple Availability Zone Gotchas
HA Kubernetes Monitoring using Prometheus and Thanos
The number of replicas only instructs deployment to always have at least 2 running instances of the deployment pods. You can find more information about replicas in Kubernetes documentation.
In the helm chart documentation, there seems to be other options like server.service.statefulsetReplica.enabled and server.service.statefulsetReplica.replica but I think those are just tools that can help to create HA prometheus. Not a ready from the get go solution.
Hope it helps.

High available kubernetes cluster? bootkube or kubeadm self-hosting

I am already running a single master kubernetes cluster now and I am doing research about setting up Highly available Kubernetes clusters. I was thinking of Multi master cluster setup then realized self-hosted cluster might be a better option to go future ready.
Additional challenge is I am doing it in Bare Metal (Meaning, I am going to use cloud vms from these cloud provider, Hetzner, Linode, DigitialOcean and they have CSI driver, cloud controller manager etc., )
In this case, I see 2 options.
Setup with bootkube (https://github.com/kubernetes-sigs/bootkube)
Setup with kubeadm self-hosting. (https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/self-hosting/)
I assume this is still an early topic hence I am not able to find guidance to choose the right approach and then correct documentation. I need this for a scalable production environment where I will start small with at least 8 nodes and can grow faster.
Is bootkube considerable for future readiness?
or kubeadm self-hosting is still in alpha stage, am I getting into a risk running a production environment?
Any good, documentation, blog, article to go in this direction?
I use Keepalived + Haproxy and Ansible to deploy HA kubernetes cluster. Now kubeadm supports join control plane command, so it easy to integrate with ansible.
You can also refer: https://github.com/kubernetes-sigs/kubespray.

Deploy Kubernetes on Self-host Production environment

I am trying to install kubernetes on Self-hosted production environment running on Ubuntu 16.04. I am not able to find any helpful guide to setup production grade kubernetes master and connect worked nodes to it.
any help is much appreciated.
you can use the kubespray to self Host production environment.
https://github.com/kubernetes-incubator/kubespray
Depends on what you understand by saying "self-host". The most people think it's about deploying kubernetes in the own environment.
If you want to compare different approaches to deploy k8s in a custom environment, refer to this article which covers a bunch of options suitable for that.
If you are interested in how to set up an HA Kubernetes cluster using kubeadm, refer to this article.
However, in kubernetes, there is a different definition of "self-hosted". It means running kubernetes itself as a workload in kubernetes. If you are interested in a real self-hosted approach (on a custom environment), refer to this article
Hope this helps
You can use typhoon which can be used to provision an HA kubernetes cluster.
Here is a sample configuration which I used to bring up my own home cluster.
A few advantages of typhoon are that you have the option of choosing your choice of a cloud provider for provisioning your infrastructure, which is done using terraform and the fact that it gives you upstream k8s is a big plus too.
Internally, it uses bootkube to bring up the temporary control plane, which would consist of
api-server
controller-manager
scheduler
and then when we have the temporary control plane object, we inject the objects to the API server to have our k8s cluster.
Have a look at this kubecon talk given by CoreOS which explains how this is working.

How to bootstrap multiple masters for HA

Kubernetes 1.2:
How do you bootstrap a second master for an HA configuration?
Can you use kube-up?
The HA doc doesn't really get into that:
https://github.com/kubernetes/kubernetes/blob/release-1.2/docs/admin/high-availability.md
Thanks
There aren't any automated scripts (like kube-up.sh) checked into the Kubernetes github repository that will create an HA cluster; you will need to understand the intricacies of building a cluster (many of which are described in the Creating a Custom Cluster from Scratch guide) and build an HA cluster from scratch or modify a "normal" cluster to make it into an HA configuration.
If you are interested in helping contribute to developing better tools for HA masters, you can join the Kubernetes High Availability special interest group.
kops (https://github.com/kubernetes/kops) is able to provision HA Kubernetes with multiple masters: https://github.com/kubernetes/kops/blob/master/docs/commands.md#other-interesting-modes
AFAIK some more upcoming work is being done in k8s 1.5 and 1.6
Some other platforms based on kubernetes supports multiple masters.
For example, Openshift origin support setup cluster with multiple masters and on load balance.
However, Openshift built some customized solutions into kubernetes. Currently k8s couldn't be decoupled from Openshift gracefully.
Personally speaking, I also prefer multiple masters configuration for HA.