Kubernetes Kops without dns

3/7/2019

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

-- João Matos
amazon-route53
amazon-web-services
docker
kops
kubernetes

1 Answer

3/8/2019

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
-- coolinuxoid
Source: StackOverflow