Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes Kops without dns

I am new to kubernetes and I am attempting to create a new cluster in aws with Kops. Unfortunately I can't seem proceed without specifying a dns-zone, which is something that I was never required to do when I used tools like docker-machine and docker swarm for the same purpose. Moreover, I do not need nor want services such as Route53.

Therefore my question is how can I create a kubernetes cluster in aws without having to worry about dns zones and route 53?

Thanks

like image 979
João Matos Avatar asked Mar 07 '19 17:03

João Matos


People also ask

Is Kops only for AWS?

Winner: KopsIt is a tool specifically created by the Kubernetes on AWS community, and works very well at doing that one thing. EKS on the other hand is still a relatively new service for AWS, and there is a lot of extra hassle to get things running with IAM, managing worker nodes, and configuring your VPC.

What is the difference between kubectl & Kops?

Kops is sometimes referred to as the 'kubectl' for spinning up clusters. Kops lets you create, destroy and upgrade Kubernetes clusters and is supported on AWS (Amazon Web Services, we cover more of this on our Kubernetes on AWS - what you need to know page) with GKE in beta support, and VMware vSphere in alpha.

Which of the following components needs to be available in order for Kops to run?

In order to correctly prepare your AWS account for kops , we require you to install the AWS CLI tools, and have API credentials for an account that has the permissions to create a new IAM account for kops later in the guide.


1 Answers

From Kops documentation

Note: If you are using Kops 1.6.2 or later, then DNS configuration is optional. Instead, a gossip-based cluster can be easily created. The only requirement to trigger this is to have the cluster name end with .k8s.local. If a gossip-based cluster is created then you can skip this section.

aws s3 mb s3://k8s-kops-gossib-bucket-name
export KOPS_STATE_STORE=s3://k8s-kops-gossib-bucket-name
aws configure
kops create secret --name mycluster.k8s.local sshpublickey admin -i ~/.ssh/id_rsa.pub
kops create cluster mycluster.k8s.local --zones us-east-2a --yes
kops validate cluster

Note: If you see such error when you validate unexpected error during validation: error listing nodes: Get https://api-cluster-k8s-local-ohpk1a-466508885.us-east-2.elb.amazonaws.com/api/v1/nodes: dial tcp: lookup api-mycluster-k8s-local-ohpk1a-466508885.us-east-2.elb.amazonaws.com on 169.234.149.254:53: no such host You need to wait for DNS update. Try again after 5-10 mins, then it will be ok.

$ kubectl get nodes
NAME                                          STATUS   ROLES    AGE   VERSION
ip-172-20-37-144.us-east-2.compute.internal   Ready    node     25m   v1.11.7
ip-172-20-45-27.us-east-2.compute.internal    Ready    master   26m   v1.11.7
ip-172-20-51-112.us-east-2.compute.internal   Ready    node     25m   v1.11.7
like image 120
coolinuxoid Avatar answered Sep 18 '22 00:09

coolinuxoid