Parametrize the kube-dns --federations command line argument in the manifest.

This parameter is later substituted with the environment variable during
the build process.
pull/6/head
Madhusudan.C.S 2016-06-23 16:16:03 -07:00
parent 18ea37a456
commit c2e70a7c35
6 changed files with 8 additions and 0 deletions

View File

@ -949,6 +949,9 @@ function kube::release::package_kube_manifests_tarball() {
objects=$(cd "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns" && find . \( -name \*.yaml -or -name \*.yaml.in -or -name \*.json \) | grep -v demo) objects=$(cd "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns" && find . \( -name \*.yaml -or -name \*.yaml.in -or -name \*.json \) | grep -v demo)
mkdir -p "${dst_dir}/dns" mkdir -p "${dst_dir}/dns"
tar c -C "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns" ${objects} | tar x -C "${dst_dir}/dns" tar c -C "${KUBE_ROOT}/cluster/saltbase/salt/kube-dns" ${objects} | tar x -C "${dst_dir}/dns"
if [[ "${FEDERATION:-}" == "true" ]]; then
sed -i 's/{{ pillar\['"'"'federations_domain_map'"'"'\] }}/- --federations="'"${FEDERATIONS_DOMAIN_MAP}"'"/g' "${dst_dir}/dns/skydns-rc.yaml.in"
fi
# This is for coreos only. ContainerVM, GCI, or Trusty does not use it. # This is for coreos only. ContainerVM, GCI, or Trusty does not use it.
cp -r "${KUBE_ROOT}/cluster/gce/coreos/kube-manifests"/* "${release_stage}/" cp -r "${KUBE_ROOT}/cluster/gce/coreos/kube-manifests"/* "${release_stage}/"

View File

@ -75,6 +75,7 @@ spec:
# command = "/kube-dns" # command = "/kube-dns"
- --domain=__PILLAR__DNS__DOMAIN__. - --domain=__PILLAR__DNS__DOMAIN__.
- --dns-port=10053 - --dns-port=10053
__PILLAR__FEDERATIONS__DOMAIN__MAP__
ports: ports:
- containerPort: 10053 - containerPort: 10053
name: dns-local name: dns-local

View File

@ -75,6 +75,7 @@ spec:
# command = "/kube-dns" # command = "/kube-dns"
- --domain={{ pillar['dns_domain'] }}. - --domain={{ pillar['dns_domain'] }}.
- --dns-port=10053 - --dns-port=10053
{{ pillar['federations_domain_map'] }}
ports: ports:
- containerPort: 10053 - containerPort: 10053
name: dns-local name: dns-local

View File

@ -75,6 +75,7 @@ spec:
# command = "/kube-dns" # command = "/kube-dns"
- --domain=$DNS_DOMAIN. - --domain=$DNS_DOMAIN.
- --dns-port=10053 - --dns-port=10053
$FEDERATIONS_DOMAIN_MAP
ports: ports:
- containerPort: 10053 - containerPort: 10053
name: dns-local name: dns-local

View File

@ -1,4 +1,5 @@
s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
s/__PILLAR__DNS__REPLICAS__/{{ pillar['dns_replicas'] }}/g s/__PILLAR__DNS__REPLICAS__/{{ pillar['dns_replicas'] }}/g
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
s/__PILLAR__FEDERATIONS__DOMAIN__MAP__/{{ pillar['federations_domain_map'] }}/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g

View File

@ -1,4 +1,5 @@
s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
s/__PILLAR__DNS__REPLICAS__/$DNS_REPLICAS/g s/__PILLAR__DNS__REPLICAS__/$DNS_REPLICAS/g
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
s/__PILLAR__FEDERATIONS__DOMAIN__MAP__/$FEDERATIONS_DOMAIN_MAP/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g