Renames kube-dns configure files from skydns* to kubedns*

This commit is contained in:
Zihong Zheng 2016-12-08 19:47:11 -08:00
parent 5628cde1bd
commit 4ad06df18f
22 changed files with 70 additions and 77 deletions

View File

@ -41,7 +41,7 @@ spec:
- --namespace=kube-system - --namespace=kube-system
- --configmap=kube-dns-autoscaler - --configmap=kube-dns-autoscaler
- --mode=linear - --mode=linear
# Should keep target in sync with cluster/addons/dns/skydns-rc.yaml.base # Should keep target in sync with cluster/addons/dns/kubedns-controller.yaml.base
- --target=Deployment/kube-dns - --target=Deployment/kube-dns
# When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate.
# If using small nodes, "nodesPerReplica" should dominate. # If using small nodes, "nodesPerReplica" should dominate.

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Makefile for the skydns underscore templates to Salt/Pillar and other formats. # Makefile for the kubedns underscore templates to Salt/Pillar and other formats.
# If you update the *.base templates, please run this Makefile before pushing. # If you update the *.base templates, please run this Makefile before pushing.
# #
@ -29,6 +29,6 @@ all: transform
%.sed: %.base %.sed: %.base
sed -f transforms2sed.sed $< | sed s/__SOURCE_FILENAME__/$</g > $@ sed -f transforms2sed.sed $< | sed s/__SOURCE_FILENAME__/$</g > $@
transform: skydns-rc.yaml.in skydns-svc.yaml.in skydns-rc.yaml.sed skydns-svc.yaml.sed transform: kubedns-controller.yaml.in kubedns-svc.yaml.in kubedns-controller.yaml.sed kubedns-svc.yaml.sed
.PHONY: transform .PHONY: transform

View File

@ -23,7 +23,7 @@ for reference.
## kube-dns Deployment and Service templates ## kube-dns Deployment and Service templates
This directory contains the base UNDERSCORE templates that can be used This directory contains the base UNDERSCORE templates that can be used
to generate the skydns-rc.yaml.in and skydns.rc.yaml.in needed in Salt format. to generate the kubedns-controller.yaml.in and kubedns.controller.yaml.in needed in Salt format.
Due to a varied preference in templating language choices, the transform Due to a varied preference in templating language choices, the transform
Makefile in this directory should be enhanced to generate all required Makefile in this directory should be enhanced to generate all required
@ -34,7 +34,7 @@ update the various scripts that supply values for your new parameter.
Here is one way you might find those scripts: Here is one way you might find those scripts:
``` ```
cd kubernetes cd kubernetes
find [a-zA-Z0-9]* -type f -exec grep skydns-rc.yaml \{\} \; -print -exec echo \; find [a-zA-Z0-9]* -type f -exec grep kubedns-controller.yaml \{\} \; -print -exec echo \;
``` ```
### Base Template files ### Base Template files
@ -42,17 +42,17 @@ find [a-zA-Z0-9]* -type f -exec grep skydns-rc.yaml \{\} \; -print -exec echo \;
These are the authoritative base templates. These are the authoritative base templates.
Run 'make' to generate the Salt and Sed yaml templates from these. Run 'make' to generate the Salt and Sed yaml templates from these.
skydns-rc.yaml.base kubedns-controller.yaml.base
skydns-svc.yaml.base kubedns-svc.yaml.base
### Generated Salt files ### Generated Salt files
skydns-rc.yaml.in kubedns-controller.yaml.in
skydns-svc.yaml.in kubedns-svc.yaml.in
### Generated Sed files ### Generated Sed files
skydns-rc.yaml.sed kubedns-controller.yaml.sed
skydns-svc.yaml.sed kubedns-svc.yaml.sed
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dns/README.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dns/README.md?pixel)]()

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml # Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
# in sync with this file. # in sync with this file.

View File

@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml # Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
# in sync with this file. # in sync with this file.
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # Warning: This is a file generated from the base underscore template file: kubedns-controller.yaml.base
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment

View File

@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml # Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
# in sync with this file. # in sync with this file.
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # Warning: This is a file generated from the base underscore template file: kubedns-controller.yaml.base
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment

View File

@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# __MACHINE_GENERATED_WARNING__ # __MACHINE_GENERATED_WARNING__
apiVersion: v1 apiVersion: v1

View File

@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.* # Warning: This is a file generated from the base underscore template file: kubedns-svc.yaml.base
# Warning: This is a file generated from the base underscore template file: skydns-svc.yaml.base
apiVersion: v1 apiVersion: v1
kind: Service kind: Service

View File

@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.* # Warning: This is a file generated from the base underscore template file: kubedns-svc.yaml.base
# Warning: This is a file generated from the base underscore template file: skydns-svc.yaml.base
apiVersion: v1 apiVersion: v1
kind: Service kind: Service

View File

@ -1064,12 +1064,12 @@ function start-kube-addons {
fi fi
if [[ "${ENABLE_CLUSTER_DNS:-}" == "true" ]]; then if [[ "${ENABLE_CLUSTER_DNS:-}" == "true" ]]; then
setup-addon-manifests "addons" "dns" setup-addon-manifests "addons" "dns"
local -r dns_rc_file="${dst_dir}/dns/skydns-rc.yaml" local -r dns_controller_file="${dst_dir}/dns/kubedns-controller.yaml"
local -r dns_svc_file="${dst_dir}/dns/skydns-svc.yaml" local -r dns_svc_file="${dst_dir}/dns/kubedns-svc.yaml"
mv "${dst_dir}/dns/skydns-rc.yaml.in" "${dns_rc_file}" mv "${dst_dir}/dns/kubedns-controller.yaml.in" "${dns_controller_file}"
mv "${dst_dir}/dns/skydns-svc.yaml.in" "${dns_svc_file}" mv "${dst_dir}/dns/kubedns-svc.yaml.in" "${dns_svc_file}"
# Replace the salt configurations with variable values. # Replace the salt configurations with variable values.
sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${dns_rc_file}" sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${dns_controller_file}"
sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${dns_svc_file}" sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${dns_svc_file}"
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
@ -1082,12 +1082,12 @@ function start-kube-addons {
federations_domain_map="${FEDERATION_NAME}=${DNS_ZONE_NAME}" federations_domain_map="${FEDERATION_NAME}=${DNS_ZONE_NAME}"
fi fi
if [[ -n "${federations_domain_map}" ]]; then if [[ -n "${federations_domain_map}" ]]; then
sed -i -e "s@{{ *pillar\['federations_domain_map'\] *}}@- --federations=${federations_domain_map}@g" "${dns_rc_file}" sed -i -e "s@{{ *pillar\['federations_domain_map'\] *}}@- --federations=${federations_domain_map}@g" "${dns_controller_file}"
else else
sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_rc_file}" sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_controller_file}"
fi fi
else else
sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_rc_file}" sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_controller_file}"
fi fi
fi fi
if [[ "${ENABLE_CLUSTER_REGISTRY:-}" == "true" ]]; then if [[ "${ENABLE_CLUSTER_REGISTRY:-}" == "true" ]]; then

View File

@ -891,12 +891,12 @@ start_kube_addons() {
fi fi
if [ "${ENABLE_CLUSTER_DNS:-}" = "true" ]; then if [ "${ENABLE_CLUSTER_DNS:-}" = "true" ]; then
setup_addon_manifests "addons" "dns" setup_addon_manifests "addons" "dns"
dns_rc_file="${addon_dst_dir}/dns/skydns-rc.yaml" dns_controller_file="${addon_dst_dir}/dns/kubedns-controller.yaml"
dns_svc_file="${addon_dst_dir}/dns/skydns-svc.yaml" dns_svc_file="${addon_dst_dir}/dns/kubedns-svc.yaml"
mv "${addon_dst_dir}/dns/skydns-rc.yaml.in" "${dns_rc_file}" mv "${addon_dst_dir}/dns/kubedns-controller.yaml.in" "${dns_controller_file}"
mv "${addon_dst_dir}/dns/skydns-svc.yaml.in" "${dns_svc_file}" mv "${addon_dst_dir}/dns/kubedns-svc.yaml.in" "${dns_svc_file}"
# Replace the salt configurations with variable values. # Replace the salt configurations with variable values.
sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${dns_rc_file}" sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${dns_controller_file}"
sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${dns_svc_file}" sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${dns_svc_file}"
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
@ -909,12 +909,12 @@ start_kube_addons() {
FEDERATIONS_DOMAIN_MAP="${FEDERATION_NAME}=${DNS_ZONE_NAME}" FEDERATIONS_DOMAIN_MAP="${FEDERATION_NAME}=${DNS_ZONE_NAME}"
fi fi
if [[ -n "${FEDERATIONS_DOMAIN_MAP}" ]]; then if [[ -n "${FEDERATIONS_DOMAIN_MAP}" ]]; then
sed -i -e "s@{{ *pillar\['federations_domain_map'\] *}}@- --federations=${FEDERATIONS_DOMAIN_MAP}@g" "${dns_rc_file}" sed -i -e "s@{{ *pillar\['federations_domain_map'\] *}}@- --federations=${FEDERATIONS_DOMAIN_MAP}@g" "${dns_controller_file}"
else else
sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_rc_file}" sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_controller_file}"
fi fi
else else
sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_rc_file}" sed -i -e "/{{ *pillar\['federations_domain_map'\] *}}/d" "${dns_controller_file}"
fi fi
fi fi
if [ "${ENABLE_CLUSTER_REGISTRY:-}" = "true" ]; then if [ "${ENABLE_CLUSTER_REGISTRY:-}" = "true" ]; then

View File

@ -58,8 +58,8 @@ endif
cp ../../saltbase/salt/generate-cert/make-ca-cert.sh ${TEMP_DIR} cp ../../saltbase/salt/generate-cert/make-ca-cert.sh ${TEMP_DIR}
# Singlenode addons # Singlenode addons
cp ../../addons/dns/skydns-rc.yaml.base ${TEMP_DIR}/addons/singlenode/skydns-rc.yaml cp ../../addons/dns/kubedns-controller.yaml.base ${TEMP_DIR}/addons/singlenode/kubedns-controller.yaml
cp ../../addons/dns/skydns-svc.yaml.base ${TEMP_DIR}/addons/singlenode/skydns-svc.yaml cp ../../addons/dns/kubedns-svc.yaml.base ${TEMP_DIR}/addons/singlenode/kubedns-svc.yaml
cp ../../addons/dashboard/dashboard-controller.yaml ${TEMP_DIR}/addons/singlenode/ cp ../../addons/dashboard/dashboard-controller.yaml ${TEMP_DIR}/addons/singlenode/
cp ../../addons/dashboard/dashboard-service.yaml ${TEMP_DIR}/addons/singlenode/ cp ../../addons/dashboard/dashboard-service.yaml ${TEMP_DIR}/addons/singlenode/
@ -76,8 +76,8 @@ endif
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile
cd ${TEMP_DIR} && sed -i.back "s|-amd64|-${ARCH}|g" addons/singlenode/*.yaml addons/multinode/*.yaml cd ${TEMP_DIR} && sed -i.back "s|-amd64|-${ARCH}|g" addons/singlenode/*.yaml addons/multinode/*.yaml
cd ${TEMP_DIR} && sed -i.back "s|__PILLAR__DNS__SERVER__|10.0.0.10|g" addons/singlenode/skydns*.yaml addons/multinode/skydns*.yaml cd ${TEMP_DIR} && sed -i.back "s|__PILLAR__DNS__SERVER__|10.0.0.10|g" addons/singlenode/kubedns*.yaml addons/multinode/kubedns*.yaml
cd ${TEMP_DIR} && sed -i.back "s|__PILLAR__DNS__DOMAIN__|cluster.local|g;s|__PILLAR__FEDERATIONS__DOMAIN__MAP__||g;" addons/singlenode/skydns*.yaml addons/multinode/skydns*.yaml cd ${TEMP_DIR} && sed -i.back "s|__PILLAR__DNS__DOMAIN__|cluster.local|g;s|__PILLAR__FEDERATIONS__DOMAIN__MAP__||g;" addons/singlenode/kubedns*.yaml addons/multinode/kubedns*.yaml
cd ${TEMP_DIR} && rm -f addons/singlenode/*.back addons/multinode/*.back static-pods/*.back cd ${TEMP_DIR} && rm -f addons/singlenode/*.back addons/multinode/*.back static-pods/*.back
# Make scripts executable before they are copied into the Docker image. If we make them executable later, in another layer # Make scripts executable before they are copied into the Docker image. If we make them executable later, in another layer

View File

@ -18,4 +18,4 @@ options:
default: cluster.local default: cluster.local
description: | description: |
The domain name to use for the Kubernetes cluster by the The domain name to use for the Kubernetes cluster by the
skydns service. kubedns service.

View File

@ -166,10 +166,10 @@ def launch_dns():
# Create the kube-system namespace that is used by the kubedns files. # Create the kube-system namespace that is used by the kubedns files.
check_call(split('kubectl create namespace kube-system')) check_call(split('kubectl create namespace kube-system'))
# Check for the kubedns replication controller. # Check for the kubedns replication controller.
return_code = call(split('kubectl get -f files/manifests/kubedns-rc.yaml')) return_code = call(split('kubectl get -f files/manifests/kubedns-controller.yaml'))
if return_code != 0: if return_code != 0:
# Create the kubedns replication controller from the rendered file. # Create the kubedns replication controller from the rendered file.
check_call(split('kubectl create -f files/manifests/kubedns-rc.yaml')) check_call(split('kubectl create -f files/manifests/kubedns-controller.yaml'))
# Check for the kubedns service. # Check for the kubedns service.
return_code = call(split('kubectl get -f files/manifests/kubedns-svc.yaml')) return_code = call(split('kubectl get -f files/manifests/kubedns-svc.yaml'))
if return_code != 0: if return_code != 0:
@ -330,7 +330,7 @@ def gather_sdn_data():
else: else:
# There is no SDN cider fall back to the kubernetes config cidr option. # There is no SDN cider fall back to the kubernetes config cidr option.
pillar['dns_server'] = get_dns_ip(hookenv.config().get('cidr')) pillar['dns_server'] = get_dns_ip(hookenv.config().get('cidr'))
# The pillar['dns_domain'] value is used in the kubedns-rc.yaml # The pillar['dns_domain'] value is used in the kubedns-controller.yaml
pillar['dns_domain'] = hookenv.config().get('dns_domain') pillar['dns_domain'] = hookenv.config().get('dns_domain')
# Use a 'pillar' dictionary so we can reuse the upstream kubedns templates. # Use a 'pillar' dictionary so we can reuse the upstream kubedns templates.
sdn_data['pillar'] = pillar sdn_data['pillar'] = pillar
@ -453,14 +453,14 @@ def render_files(reldata=None):
# Render the files/manifests/master.json that contains parameters for # Render the files/manifests/master.json that contains parameters for
# the apiserver, controller, and controller-manager # the apiserver, controller, and controller-manager
render('master.json', target, context) render('master.json', target, context)
# Source: ...cluster/addons/dns/skydns-svc.yaml.in # Source: ...cluster/addons/dns/kubedns-svc.yaml.in
target = os.path.join(rendered_manifest_dir, 'kubedns-svc.yaml') target = os.path.join(rendered_manifest_dir, 'kubedns-svc.yaml')
# Render files/kubernetes/kubedns-svc.yaml for the DNS service. # Render files/kubernetes/kubedns-svc.yaml for the DNS service.
render('kubedns-svc.yaml', target, context) render('kubedns-svc.yaml', target, context)
# Source: ...cluster/addons/dns/skydns-rc.yaml.in # Source: ...cluster/addons/dns/kubedns-controller.yaml.in
target = os.path.join(rendered_manifest_dir, 'kubedns-rc.yaml') target = os.path.join(rendered_manifest_dir, 'kubedns-controller.yaml')
# Render files/kubernetes/kubedns-rc.yaml for the DNS pod. # Render files/kubernetes/kubedns-controller.yaml for the DNS pod.
render('kubedns-rc.yaml', target, context) render('kubedns-controller.yaml', target, context)
def status_set(level, message): def status_set(level, message):

View File

@ -12,7 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # This file should be kept in sync with cluster/addons/dns/kubedns-controller.yaml.base
# Warning: This is a file generated from the base underscore template file: kubedns-controller.yaml.base
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment

View File

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This file should be kept in sync with cluster/images/hyperkube/dns-svc.yaml # This file should be kept in sync with cluster/addons/dns/kubedns-svc.yaml.base
# Warning: This is a file generated from the base underscore template file: skydns-svc.yaml.base # Warning: This is a file generated from the base underscore template file: kubedns-svc.yaml.base
apiVersion: v1 apiVersion: v1
kind: Service kind: Service

View File

@ -62,5 +62,5 @@ DNS_DOMAIN="cluster.local"
ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false}" ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false}"
#Generate dns files #Generate dns files
sed -f "${KUBE_ROOT}/cluster/addons/dns/transforms2sed.sed" < "${KUBE_ROOT}/cluster/addons/dns/skydns-rc.yaml.base" | sed -f "${KUBE_ROOT}/cluster/libvirt-coreos/forShellEval.sed" > "${KUBE_ROOT}/cluster/libvirt-coreos/skydns-rc.yaml" sed -f "${KUBE_ROOT}/cluster/addons/dns/transforms2sed.sed" < "${KUBE_ROOT}/cluster/addons/dns/kubedns-controller.yaml.base" | sed -f "${KUBE_ROOT}/cluster/libvirt-coreos/forShellEval.sed" > "${KUBE_ROOT}/cluster/libvirt-coreos/kubedns-controller.yaml"
sed -f "${KUBE_ROOT}/cluster/addons/dns/transforms2sed.sed" < "${KUBE_ROOT}/cluster/addons/dns/skydns-svc.yaml.base" | sed -f "${KUBE_ROOT}/cluster/libvirt-coreos/forShellEval.sed" > "${KUBE_ROOT}/cluster/libvirt-coreos/skydns-svc.yaml" sed -f "${KUBE_ROOT}/cluster/addons/dns/transforms2sed.sed" < "${KUBE_ROOT}/cluster/addons/dns/kubedns-svc.yaml.base" | sed -f "${KUBE_ROOT}/cluster/libvirt-coreos/forShellEval.sed" > "${KUBE_ROOT}/cluster/libvirt-coreos/kubedns-svc.yaml"

View File

@ -177,8 +177,8 @@ function initialize-pool {
mkdir -p "$POOL_PATH/kubernetes/addons" mkdir -p "$POOL_PATH/kubernetes/addons"
if [[ "$ENABLE_CLUSTER_DNS" == "true" ]]; then if [[ "$ENABLE_CLUSTER_DNS" == "true" ]]; then
render-template "$ROOT/namespace.yaml" > "$POOL_PATH/kubernetes/addons/namespace.yaml" render-template "$ROOT/namespace.yaml" > "$POOL_PATH/kubernetes/addons/namespace.yaml"
render-template "$ROOT/skydns-svc.yaml" > "$POOL_PATH/kubernetes/addons/skydns-svc.yaml" render-template "$ROOT/kubedns-svc.yaml" > "$POOL_PATH/kubernetes/addons/kubedns-svc.yaml"
render-template "$ROOT/skydns-rc.yaml" > "$POOL_PATH/kubernetes/addons/skydns-rc.yaml" render-template "$ROOT/kubedns-controller.yaml" > "$POOL_PATH/kubernetes/addons/kubedns-controller.yaml"
fi fi
virsh pool-refresh $POOL virsh pool-refresh $POOL

View File

@ -28,8 +28,8 @@ kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
workspace=$(pwd) workspace=$(pwd)
# Process salt pillar templates manually # Process salt pillar templates manually
sed -e "s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-rc.yaml.in" > "${workspace}/skydns-rc.yaml" sed -e "s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/kubedns-controller.yaml.in" > "${workspace}/kubedns-controller.yaml"
sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-svc.yaml.in" > "${workspace}/skydns-svc.yaml" sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/kubedns-svc.yaml.in" > "${workspace}/kubedns-svc.yaml"
# Federation specific values. # Federation specific values.
if [[ "${FEDERATION:-}" == "true" ]]; then if [[ "${FEDERATION:-}" == "true" ]]; then
@ -38,14 +38,14 @@ if [[ "${FEDERATION:-}" == "true" ]]; then
FEDERATIONS_DOMAIN_MAP="${FEDERATION_NAME}=${DNS_ZONE_NAME}" FEDERATIONS_DOMAIN_MAP="${FEDERATION_NAME}=${DNS_ZONE_NAME}"
fi fi
if [[ -n "${FEDERATIONS_DOMAIN_MAP}" ]]; then if [[ -n "${FEDERATIONS_DOMAIN_MAP}" ]]; then
sed -i -e "s/{{ pillar\['federations_domain_map'\] }}/- --federations=${FEDERATIONS_DOMAIN_MAP}/g" "${workspace}/skydns-rc.yaml" sed -i -e "s/{{ pillar\['federations_domain_map'\] }}/- --federations=${FEDERATIONS_DOMAIN_MAP}/g" "${workspace}/kubedns-controller.yaml"
else else
sed -i -e "/{{ pillar\['federations_domain_map'\] }}/d" "${workspace}/skydns-rc.yaml" sed -i -e "/{{ pillar\['federations_domain_map'\] }}/d" "${workspace}/kubedns-controller.yaml"
fi fi
else else
sed -i -e "/{{ pillar\['federations_domain_map'\] }}/d" "${workspace}/skydns-rc.yaml" sed -i -e "/{{ pillar\['federations_domain_map'\] }}/d" "${workspace}/kubedns-controller.yaml"
fi fi
# Use kubectl to create kube-dns controller and service # Use kubectl to create kube-dns controller and service
"${kubectl}" create -f "${workspace}/skydns-rc.yaml" "${kubectl}" create -f "${workspace}/kubedns-controller.yaml"
"${kubectl}" create -f "${workspace}/skydns-svc.yaml" "${kubectl}" create -f "${workspace}/kubedns-svc.yaml"

View File

@ -73,17 +73,17 @@ addon-dir-create:
{% endif %} {% endif %}
{% if pillar.get('enable_cluster_dns', '').lower() == 'true' %} {% if pillar.get('enable_cluster_dns', '').lower() == 'true' %}
/etc/kubernetes/addons/dns/skydns-svc.yaml: /etc/kubernetes/addons/dns/kubedns-svc.yaml:
file.managed: file.managed:
- source: salt://kube-addons/dns/skydns-svc.yaml.in - source: salt://kube-addons/dns/kubedns-svc.yaml.in
- template: jinja - template: jinja
- group: root - group: root
- dir_mode: 755 - dir_mode: 755
- makedirs: True - makedirs: True
/etc/kubernetes/addons/dns/skydns-rc.yaml: /etc/kubernetes/addons/dns/kubedns-controller.yaml:
file.managed: file.managed:
- source: salt://kube-addons/dns/skydns-rc.yaml.in - source: salt://kube-addons/dns/kubedns-controller.yaml.in
- template: jinja - template: jinja
- group: root - group: root
- dir_mode: 755 - dir_mode: 755

View File

@ -1,2 +1,2 @@
binaries binaries
skydns* kubedns*

View File

@ -41,15 +41,15 @@ function init {
function deploy_dns { function deploy_dns {
echo "Deploying DNS on Kubernetes" echo "Deploying DNS on Kubernetes"
sed -e "s/\\\$DNS_DOMAIN/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-rc.yaml.sed" > skydns-rc.yaml sed -e "s/\\\$DNS_DOMAIN/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/kubedns-controller.yaml.sed" > kubedns-controller.yaml
sed -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-svc.yaml.sed" > skydns-svc.yaml sed -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/kubedns-svc.yaml.sed" > kubedns-svc.yaml
KUBEDNS=`eval "${KUBECTL} get services --namespace=kube-system | grep kube-dns | cat"` KUBEDNS=`eval "${KUBECTL} get services --namespace=kube-system | grep kube-dns | cat"`
if [ ! "$KUBEDNS" ]; then if [ ! "$KUBEDNS" ]; then
# use kubectl to create skydns rc and service # use kubectl to create kubedns controller and service
${KUBECTL} --namespace=kube-system create -f skydns-rc.yaml ${KUBECTL} --namespace=kube-system create -f kubedns-controller.yaml
${KUBECTL} --namespace=kube-system create -f skydns-svc.yaml ${KUBECTL} --namespace=kube-system create -f kubedns-svc.yaml
echo "Kube-dns controller and service are successfully deployed." echo "Kube-dns controller and service are successfully deployed."
else else