From e12fa40c1de070f7cd5711e0d57c003a75a6ce7f Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 24 Jun 2016 15:28:55 -0400 Subject: [PATCH 1/3] Tracked addition of federation, sed support in kube DNS The kube DNS app recently gained support for federation (whatever that is), including a new Salt parameter. It also gained alternate templates, intended to be friendly to `sed`. Fortunately, those do not demand a federation parameter. --- cluster/ubuntu/deployAddons.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/ubuntu/deployAddons.sh b/cluster/ubuntu/deployAddons.sh index 47a5b9773b5..87e7d6b7385 100755 --- a/cluster/ubuntu/deployAddons.sh +++ b/cluster/ubuntu/deployAddons.sh @@ -41,8 +41,8 @@ function init { function deploy_dns { echo "Deploying DNS on Kubernetes" - sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g;" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-rc.yaml.in" > skydns-rc.yaml - sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-svc.yaml.in" > skydns-svc.yaml + sed -e "s/\\\$DNS_REPLICAS/${DNS_REPLICAS}/g;s/\\\$DNS_DOMAIN/${DNS_DOMAIN}/g;" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-rc.yaml.sed" > skydns-rc.yaml + sed -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-svc.yaml.in" > skydns-svc.yaml KUBEDNS=`eval "${KUBECTL} get services --namespace=kube-system | grep kube-dns | cat"` From 6aeb5da23935a264a7622b616cc3ca55762dbf4a Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 24 Jun 2016 22:21:35 -0400 Subject: [PATCH 2/3] Fixed deployAddons.sh to use sed template for skydns-svc.yaml My original change neglected to change the template from the salt one to the sed one. --- cluster/ubuntu/deployAddons.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/ubuntu/deployAddons.sh b/cluster/ubuntu/deployAddons.sh index 87e7d6b7385..568dbe96dc3 100755 --- a/cluster/ubuntu/deployAddons.sh +++ b/cluster/ubuntu/deployAddons.sh @@ -42,7 +42,7 @@ function init { function deploy_dns { echo "Deploying DNS on Kubernetes" sed -e "s/\\\$DNS_REPLICAS/${DNS_REPLICAS}/g;s/\\\$DNS_DOMAIN/${DNS_DOMAIN}/g;" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-rc.yaml.sed" > skydns-rc.yaml - sed -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-svc.yaml.in" > skydns-svc.yaml + sed -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns/skydns-svc.yaml.sed" > skydns-svc.yaml KUBEDNS=`eval "${KUBECTL} get services --namespace=kube-system | grep kube-dns | cat"` From 33e176eb9a7d677859979fc725655c4998899184 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 24 Jun 2016 22:29:40 -0400 Subject: [PATCH 3/3] Added note to developers about adding parameters to skydns Added a friendly note, with a suggestion of how to find the scripts. --- cluster/saltbase/salt/kube-dns/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cluster/saltbase/salt/kube-dns/README.md b/cluster/saltbase/salt/kube-dns/README.md index a9ee8e4e69c..c658f26663f 100644 --- a/cluster/saltbase/salt/kube-dns/README.md +++ b/cluster/saltbase/salt/kube-dns/README.md @@ -7,6 +7,14 @@ Due to a varied preference in templating language choices, the transform Makefile in this directory should be enhanced to generate all required formats from the base underscore templates. +**NOTE WELL**: Developers, when you add a parameter you should also +update the various scripts that supply values for your new parameter. +Here is one way you might find those scripts: +``` +cd kubernetes +find [a-zA-Z0-9]* -type f -exec grep skydns-rc.yaml \{\} \; -print -exec echo \; +``` + ## Base Template files These are the authoritative base templates.