Setup an ETCD cluster behind an ELB using EC2 instances - amazon-web-services

I am new to Kubernetes and have a requirement in which have to setup an ETCD cluster behind an ELB. Our K8s cluster will be hosted using Rancher. Can anyone please share the steps or link for the same.

There are 2 options:
1: If you will import cluster into rancher, then #suren is right. You basically need to create Kubernetes cluster that comforms all of your needs then import that into Rancher.
2: If you plan to launch clusters using Rancher, then you need to create NodeTemplate that uses AWS EC2 for etcd nodes. Then you can launch cluster by ticking master, etcd and worker nodes separately and reference your etcd NodeTemplate in etcd node group.

Related

Is it possible to add a elb (cloud provider) to an existing kubernetes cluster running on RHEL8 EC2?

i have a cluster running on aws ec2 and not a managed EKS, i'm trying to add a loadbalancer to the cluster without restarting it or initializing a new node, is that possible ? i've already set the permission and tags related to this post https://blog.heptio.com/setting-up-the-kubernetes-aws-cloud-provider-6f0349b512bd
But the thing is that we must add the flag --cloud-provider=aws to the Kubelet before adding the node to the cluster.
Is there any other options or other way to do it ?
[kubectl get nodes][1]
You can try using AWS load balancer controller, it works with both managed and self-managed K8s clusters https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/
Zee

How can I give access to statping deployed outside k8s cluster to monitor k8s services uptime?

I want statping to be independent of the infra it is monitoring. But I want to check the services uptime which are on clusterIP inside the k8s EKS cluster. Will setting up kubeconfig on the EC2 instance help ?
There are multiple ways to access Kubernetes Services from the statping EC2 Instance.
All of them are discussed in https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#so-many-proxies
kubectl proxy https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#using-kubectl-proxy is a good option for your use case if you already have kubeconfig on the statping EC2 Instance.
You can use https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#manually-constructing-apiserver-proxy-urls to construct the Proxy URLs.

How can I add external node to EKS cluster?

I am considering to use AWS EKS to deploy kubernete cluster but I wonder whether it supports bring other nodes in the cluster? Other nodes may come from GCP, on-prem infra. etc.

NodeCreationFailure-> Unhealthy nodes in the kubernetes cluster

I have created a Amazon Elastic Kubernetes Service in US East (Ohio)us-east-2 region. After cluster setup I have created Fargate profile which is done successfully. Now I am trying to Add a Node group but its ends with showing error "NodeCreationFailure Unhealthy nodes in the kubernetes cluster" issue. What's the reason?
your nodes are unable to register with your Amazon EKS cluster.
A quick and dirty solution consists in adding AmazonEKS_CNI_Policy to the worker nodegroup role.
If that's solve the problem please be aware that the recommended approach is instead:
https://docs.aws.amazon.com/eks/latest/userguide/cni-iam-role.html

Acess S3 from a pod in Kubernetes Cluster

I am new to Kubernetes and I am transitioning some of the apps to K8S Cluster.
I have tremendous use of S3 in the containers that I used through Roles in AWS.
I have configured a 2 node cluster using kubeadm using Ec2 instances(not EKS).
But I am stuck as whenever I run the container through pods I get error:
**Could not connect to the endpoint URL:"https://<bucket_name>.s3.amazonaws.com/**
I have IAM roles attached to the Ec2 instances that are configured as master and nodes.
Please suggest the best way to establish S3 connection through pods.
Any document/gitrepo link will be highly appreciated. Thanks in advance.