sguyennet / terraform-vsphere-kubespray

Deploy a Kubernetes HA cluster on VMware vSphere
https://blog.inkubate.io/install-and-manage-automatically-a-kubernetes-cluster-on-vmware-vsphere-with-terraform-and-kubespray/
Apache License 2.0
174 stars 89 forks source link

adding nameservers to docker options fails #5

Closed martinmike2 closed 5 years ago

martinmike2 commented 5 years ago

My tfvar looks like: k8s_dns = "::IP::"

also, what is the k8s_dns_mode var supposed to be? no documentation for it

TASK [docker : add system nameservers to docker options] *** Wednesday 03 October 2018 11:55:31 +0000 (0:00:01.310) 0:03:36.671 * fatal: [k8s-kubespray-master-0]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"} fatal: [k8s-kubespray-master-1]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"} fatal: [k8s-kubespray-master-2]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"} fatal: [k8s-kubespray-worker-0]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"} fatal: [k8s-kubespray-worker-1]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"} fatal: [k8s-kubespray-worker-2]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ docker_dns_servers | union(system_nameservers.stdout_lines) | unique }}): coercing to Unicode: need string or buffer, list found"}

sguyennet commented 5 years ago

Hi, You can find the description of all the parameters in the variables.tf file:

variable "k8s_dns_mode" { description = "Which DNS to use for the internal Kubernetes cluster name resolution (example: kubedns, coredns, etc.)" default = "kubedns" }

Before Kubernetes version 1.11 the default DNS service in the cluster was kubedns. It is now coredns. This parameter let you choose between the two options.

Regarding your issue with the k8s_dns parameter, you have to specify an IP. Is there a reason you have ::IP::?

martinmike2 commented 5 years ago

I was just obfuscating, but thank you. Took another look at the variables file after getting some sleep and saw what you posted, put in a value, and bam it worked! Thank you for this terraform setup!