From ed3c63a06da2cb04b7415cb1b5ba6340c3fa229a Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Tue, 19 Feb 2019 12:09:42 -0600 Subject: [PATCH] Add DNS requirement for kubernetes and helm. `helm init` is being execute before networking and DNS is properly configured in the controller. A dependency was added to kubernetes to setup DNS, helm manifest was updated to depend on kubernetes. Also, the `--skip-refresh` flag was added to helm init for second controller to avoid timeout scenarios on proxy enviroments. Closes-Bug: 1814968 Change-Id: I65759314b3a861e7fdb428889aa5f5c1c7037661 Suggested-by: Mingyuan Qi Signed-off-by: Erich Cordoba --- puppet-manifests/src/modules/platform/manifests/helm.pp | 7 +++++-- .../src/modules/platform/manifests/kubernetes.pp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/puppet-manifests/src/modules/platform/manifests/helm.pp b/puppet-manifests/src/modules/platform/manifests/helm.pp index 47b5effe14..31396dae90 100644 --- a/puppet-manifests/src/modules/platform/manifests/helm.pp +++ b/puppet-manifests/src/modules/platform/manifests/helm.pp @@ -76,9 +76,12 @@ class platform::helm } } else { - exec { 'initialize helm': + + Class['::platform::kubernetes::master'] + + -> exec { 'initialize helm': environment => [ 'KUBECONFIG=/etc/kubernetes/admin.conf', 'HOME=/home/wrsroot' ], - command => 'helm init --client-only', + command => 'helm init --skip-refresh --client-only', logoutput => true, user => 'wrsroot', group => 'wrs', diff --git a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp index 2045f2791d..97bc539674 100644 --- a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp +++ b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp @@ -16,10 +16,14 @@ class platform::kubernetes::kubeadm { $iptables_file = "net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1" + # Ensure DNS is configured as name resolution is required when + # kubeadm init is run. + Class['::platform::dns'] + # Update iptables config. This is required based on: # https://kubernetes.io/docs/tasks/tools/install-kubeadm # This probably belongs somewhere else - initscripts package? - file { '/etc/sysctl.d/k8s.conf': + -> file { '/etc/sysctl.d/k8s.conf': ensure => file, content => $iptables_file, owner => 'root',