Terraform RKE provider vs rancher2 provider - amazon-web-services

I am new to terraform.
Now we are planning to use terraform to rebuild our infrastrucure on AWS.
We are running kubernetes clusters managed with rancher on AWS.
We have one k8s cluster that was built with RKE, which also hosts rancher, and a couple of other kubernetes clusters that was created by rancher.
There are two external modules that might be helpful: RKE provider and rancher2 provider.
The goal is to manage everything with terraform. I can build a kubernetes cluster with terraform RKE provider. My question is how do I install rancher on it, and how do I use rancher to create other k8s clusters in teraform?

RKE and rancher are two different things.
One common misconception among new users is that RKE will install Rancher for you. While Rancher uses RKE under the hood, RKE can also be used to create Kubernetes clusters as a standalone piece of software.
Reference: https://rancher.com/blog/2019/2019-02-04-rancher-vs-rke/

Related

UI in aws ubuntu 16.04 for kubernetes dashboard

I set up kubernetes environment in aws ec2(ubuntu 16.04) instances. There is one master and two slaves. I have created the dashboard in the master node, to access it i required web based UI. I tried to install gnome environment in ec2 instance, but its not working. Is there any other way to access the dashboard of kubernetes or setting up web-UI in aws ec2 instance?
According to the AWS documentation:
This tutorial guides you through deploying the Kubernetes
dashboard to your Amazon EKS cluster, complete with CPU and memory
metrics. It also helps you to create an Amazon EKS administrator
service account that you can use to securely connect to the dashboard
to view and control your cluster.
EDIT:
Check out those guides:
Kubernetes Visualizer
How to Visualize Docker & Kubernetes
Setting up Kubernetes visualization of a cluster
They will help you learn about and setup a Visualizer.
Please let me know if that helped.

AWS EKS - On prem Worker node

I am new to AWS EKS - I have an application for which I need one worker node (a pod) of the Kubernetes to run on my on-premise infrastructure. Is that possible and if yes then how can I achieve that ?
In theory you can run EKS and on-prem kubernetes clusters at the same time, but managing them via a single federation control plane. But I've never tried to use it with EKS, although EKS is mostly vanilla kubernetes, so it should work.

Choosing microservice using AWS EC2 and ECS

I am trying to develop a spring cloud micro services. And I planned to deploy into AWS cloud. When I reading AWS resources I found that ECS providing configuration less environment for deploying microservices other than EC2. My doubt is that
Can I choose ECS resource for my complete services deployment without configurations?
For creating ECS service, is EC2 instance mandatory? Can I use ECS only in my account without creating EC2 VM? I need to know about ECS is alternative for EC2?
ECS is a service which offers clustering of vm for docker container, manages container lifecycle.
1) Yes. You can use ECS for your service deployment and it needs some basic configuration which will be one time.
2) No. To run docker container you need EC2 instance without that its not possible to run. EC2 instance are managed by ECS so you only need to provide some config like region,security group etc.
For complete config and deployment refer below link.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html

Creating kubernetes cluster inside an existing VPC in AWS

To create kubernetes cluster in AWS, I use the set up script "https://get.k8s.io". That script creates a new VPC automatically, but I want to create kubernetes cluster inside an existing VPC in AWS. Is there a way to do it?
I checked /kubernetes/cluster/aws/config-default.sh file, but there doesn't seem to be any environment variables about VPC.
You can add this ENV variable (we are using ver 1.1.8)
export VPC_ID=vpc-YOURID
Also Kubernetes creates a VPC with 172.20.0.0/16 and I think it expects this.
EC2 instances are used as a backend for kubernetes in the AWS cloud.
You can always run necessary number of instances manually and deploy any service above.
The following article describes how to launch your EC2 instance:
http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/getting-started-launch-instance.html
By the way, Amazon already provides a managed service similar to kubernetes based on docker. I will suggest you to consider using it.
More information here:
https://aws.amazon.com/ecs/details/

Does AWS support Kubernetes?

I've read that AWS does not support Kubernetes and builds their own Docker orchestration engine EC2 Container Service. However, on Kubernetes getting-started -page there is a guide on how to run Kubernetes on AWS:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/aws.md
Which is right?
You can install Kubernetes on a normal Amazon EC2 server.
The new container service is a separate offering by Amazon, called ECS.
EDIT: AWS released in 2018 a new container service for Kubernetes called EKS: https://aws.amazon.com/eks/
Amazon Elastic Container Service for Kubernetes (Amazon EKS) makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS. Amazon EKS runs the Kubernetes management infrastructure for you across multiple AWS availability zones to eliminate a single point of failure.
Kubernetes provides scripts to simple setup a cluster on a set of EC2 machines. The setup does pretty much everything needed to get started quickly.
Here is the link: https://github.com/GoogleCloudPlatform/kubernetes/blob/release-1.0/docs/getting-started-guides/aws.md
Yes its possible to setup Kubernetes on AWS See:http://kubernetes.io/v1.0/docs/getting-started-guides/aws.html
You can also manually setup Kubernetes on AWS by launching a EC2 instance
Foe setting in Redhat ami https://access.redhat.com/articles/1353773
(Note: Kubernetes needs flannel network to be setup for managing networking between docker containers running on different hosts(minions)
Amazons Container Service is unrelated to Kubernetes.
There are 3 main options for installing Kubernetes on AWS:
CoreOS have a cli for installing and managing kubernetes on aws: https://coreos.com/kubernetes/docs/latest/kubernetes-on-aws.html
Kubernetes have some scripts for setting up a cluster on AWS: http://kubernetes.io/docs/getting-started-guides/aws/
Manual installation on EC2. Lots of options here: http://kubernetes.io/docs/getting-started-guides/#cloud
As an aside minikube is now a thing which is nice for running locally to try stuff out:
http://kubernetes.io/docs/getting-started-guides/minikube/
AWS recently launched EKS, which provides a managed k8s master nodes. This should be
what you are looking for.
Yes. You can use kubeadm to install kubernetes on EC2 instances.
There are other tools also available.
KOPS
EKS
Kubeadm