Remove the resolv.conf workaround

Newer Kubernetes supports a mode that eliminates the need for the
resolv.conf workaround. This removes the workaround and changes
the code to use the new mode.

Change-Id: I14a55d64b8fd49f71a78c0df2b75cd32d9f6a696
This commit is contained in:
Kevin Fox 2017-09-25 12:42:14 -07:00
parent 3c8340e8eb
commit 1d1a9c2177
33 changed files with 24 additions and 74 deletions

View File

@ -48,9 +48,9 @@ Dependencies::
docker == 1.12.6
helm >= 2.4.1
kubectl >= 1.6.4
kubeadm >= 1.6.4
kubelet >= 1.6.4
kubectl >= 1.8.0
kubeadm >= 1.8.0
kubelet >= 1.8.0
kubernetes-cni >= 0.5.1
.. note::
@ -489,10 +489,6 @@ Create and register the Kolla config maps::
cinder-scheduler cinder-volume iscsid tgtd keepalived \
placement-api placement-api-haproxy
Enable resolv.conf workaround::
kolla-kubernetes/tools/setup-resolv-conf.sh kolla
Build all Helm microcharts, service charts, and metacharts::
kolla-kubernetes/tools/helm_build_all.sh .
@ -514,7 +510,6 @@ Create a local cloud.yaml file for the deployment of the charts::
base_distro: "centos"
install_type: "source"
tunnel_interface: "docker0"
resolve_conf_net_host_workaround: true
keystone:
all:
admin_port_external: "true"

View File

@ -227,7 +227,6 @@ storage_interface: "eth0"
########################
kolla_kubernetes_ovs_setup_bridge: "yes"
kolla_kubernetes_ovs_add_port: "yes"
enable_resolve_conf_net_host_workaround: "yes"
########################
# Ceph variables

View File

@ -18,7 +18,6 @@ common:
image_pull_policy: IfNotPresent
container_config_directory: /var/lib/kolla/config_files
kubernetes_entrypoint: false
resolve_conf_net_host_workaround: true
kolla_kubernetes_external_vip: 172.18.0.1
kolla_kubernetes_external_subnet: 24
kube_logger: true

View File

@ -1,20 +1,9 @@
{{- define "common_volume_mounts" }}
{{- $localVals := dict }}
{{- $c1 := dict "searchPath" .searchPath "Values" .Values }}
{{- $_ := set $c1 "key" "resolve_conf_net_host_workaround" }}
{{- $_ := set $c1 "retDict" $localVals }}
{{- $_ := set $c1 "retKey" "resolve_conf_net_host_workaround" }}
{{- $_ := include "kolla_val_get_raw" $c1 }}
- mountPath: /var/log/kolla/
name: kolla-logs
- mountPath: /etc/localtime
name: host-etc-localtime
readOnly: true
{{- if and .netHostTrue $localVals.resolve_conf_net_host_workaround }}
- mountPath: /etc/resolv.conf
name: resolv-conf
subPath: resolv.conf
{{- end }}
{{- end }}
{{- define "common_containers" }}
@ -47,11 +36,6 @@
{{- $_ := set $c1 "retDict" $localVals }}
{{- $_ := set $c1 "retKey" "kube_logger" }}
{{- $_ := include "kolla_val_get_raw" $c1 }}
{{- $c2 := dict "searchPath" .searchPath "Values" .Values }}
{{- $_ := set $c2 "key" "resolve_conf_net_host_workaround" }}
{{- $_ := set $c2 "retDict" $localVals }}
{{- $_ := set $c2 "retKey" "resolve_conf_net_host_workaround" }}
{{- $_ := include "kolla_val_get_raw" $c2 }}
{{- $loggerConfigmapName := include "kolla_val_get_str" (dict "key" "logger_configmap_name" "searchPath" .searchPath "Values" .Values ) }}
- name: host-etc-localtime
hostPath:
@ -65,11 +49,6 @@
{{- $loggerConfigmapNameDefault := printf "%s-logging" .resourceName }}
name: {{ $loggerConfigmapName | default $loggerConfigmapNameDefault }}
{{- end }}
{{- if and .netHostTrue $localVals.resolve_conf_net_host_workaround }}
- name: resolv-conf
configMap:
name: resolv-conf
{{- end }}
{{- end }}
{{- define "common_bootstrap_env_vars" }}

View File

@ -16,6 +16,7 @@ kind: Pod
metadata:
name: ceph-admin
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -25,6 +25,7 @@ spec:
component: ceph
system: rbd
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -37,6 +37,7 @@ spec:
component: {{ $resourceName }}
system: {{ $elementName }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
nodeSelector:

View File

@ -37,6 +37,7 @@ spec:
component: {{ $serviceName }}
system: {{ $elementName }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
nodeSelector:

View File

@ -51,6 +51,7 @@ spec:
service: {{ $serviceName }}
type: {{ $serviceType }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
nodeSelector:
{{ $selectorKey }}: {{ $selectorValue | quote }}

View File

@ -28,6 +28,7 @@ spec:
component: iscsi-target
system: iscsi-target
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
hostPID: True

View File

@ -27,6 +27,7 @@ spec:
component: iscsid
system: iscsid
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
nodeSelector:

View File

@ -29,6 +29,7 @@ spec:
component: keepalived
system: keepalived
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
nodeSelector:
{{ $selectorKey }}: {{ $selectorValue | quote }}

View File

@ -32,6 +32,7 @@ spec:
component: neutron
system: dhcp-agent
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
hostPID: True

View File

@ -37,6 +37,7 @@ spec:
component: neutron
system: l3-agent-{{ $restype }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
hostPID: True

View File

@ -27,6 +27,7 @@ spec:
component: neutron
system: metadata-agent-{{ $restype }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
nodeSelector:
{{ $selectorKey }}: {{ $selectorValue | quote }}

View File

@ -37,6 +37,7 @@ spec:
component: neutron
system: openvswitch-agent-{{ $restype }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
hostPID: True #needed for openvswitch pid file

View File

@ -48,6 +48,7 @@ spec:
component: {{ $serviceName }}
system: {{ $elementName }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
nodeSelector:
{{ $selectorKey }}: {{ $selectorValue | quote }}

View File

@ -39,6 +39,7 @@ spec:
component: {{ $serviceName }}
system: {{ $elementName }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -27,6 +27,7 @@ spec:
component: openvswitch
system: openvswitch-db-{{ $restype }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
nodeSelector:

View File

@ -43,6 +43,7 @@ spec:
component: openvswitch
system: openvswitch-vswitchd-{{ $restype }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
hostPID: True #Needed for pidfile.

View File

@ -21,6 +21,7 @@ metadata:
spec:
template:
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -19,6 +19,7 @@ kind: Pod
metadata:
name: ceph-bootstrap-osd{{ $index }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -34,6 +34,7 @@ spec:
component: ceph
system: mon
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -19,6 +19,7 @@ kind: Pod
metadata:
name: ceph-osd{{ $index }}
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostPID: True
nodeSelector:

View File

@ -28,6 +28,7 @@ spec:
component: tgtd
system: tgtd
spec:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: True
hostIPC: True
nodeSelector:

View File

@ -1,6 +1,5 @@
kolla_kubernetes_ovs_setup_bridge: "yes"
kolla_kubernetes_ovs_add_port: "no"
enable_resolve_conf_net_host_workaround: "yes"
rabbitmq_management_external: "yes"
kolla_kubernetes_external_bridge_ip: "172.18.0.1"

View File

@ -1,6 +1,5 @@
kolla_kubernetes_ovs_setup_bridge: "yes"
kolla_kubernetes_ovs_add_port: "no"
enable_resolve_conf_net_host_workaround: "yes"
rabbitmq_management_external: "yes"
kolla_kubernetes_external_bridge_ip: "172.18.0.1"

View File

@ -1,25 +0,0 @@
#!/bin/bash -e
NAMESPACE=$1
function finish {
DNS_IP=`kubectl get svc --namespace=kube-system -l k8s-app=kube-dns -o \
jsonpath='{.items[*].spec.clusterIP}'`
DOMAIN_NAME=$(kubectl get pod --namespace=kube-system -l k8s-app=kube-dns -o \
jsonpath={..args} | grep "\-\-domain=" | awk -F '=' '{print $2}' | awk '{print $1}')
DOMAIN_NAME=${DOMAIN_NAME%%.}
cat > /tmp/$$ <<EOF
search $NAMESPACE.svc.$DOMAIN_NAME svc.$DOMAIN_NAME $DOMAIN_NAME
nameserver $DNS_IP
options ndots:5
EOF
kubectl create configmap resolv-conf --from-file=resolv.conf=/tmp/$$ --namespace $NAMESPACE
rm -f /tmp/$$
}
if [ "x$1" == "x--partial-async" ]; then
finish &
else
finish
fi

View File

@ -52,7 +52,6 @@ k8s_setup () {
kubectl label node 172.16.35.12 --overwrite kolla_controller=true
kubectl create namespace kolla
kolla-kubernetes/tools/secret-generator.py create
kolla-kubernetes/tools/setup-resolv-conf.sh kolla
}
ceph_startup () {

View File

@ -104,9 +104,6 @@ tools/build_example_yaml.py
# Setting up namespace and secret
setup_namespace_secrets
# Setting up resolv.conf workaround
setup_resolv_conf_common
tunnel_interface=docker0
if [ "x$CONFIG" == "xceph-multi" ]; then
interface=$(netstat -ie | grep -B1 \

View File

@ -111,6 +111,3 @@ kubectl create namespace kolla
tools/secret-generator.py create
}
function setup_resolv_conf_common {
tools/setup-resolv-conf.sh kolla
}

View File

@ -47,9 +47,6 @@ setup_helm_common
# Setting up namespace and secret
setup_namespace_secrets
# Setting up resolv.conf workaround
setup_resolv_conf_common
kollakube res create configmap \
mariadb keystone horizon rabbitmq memcached nova-api nova-conductor \
nova-scheduler glance-api-haproxy glance-registry-haproxy glance-api \

View File

@ -222,11 +222,6 @@ kollakube res create configmap \
placement-api placement-api-haproxy
## Enable resolv.conf workaround
echo "Enable resolv.conf workaround"
/opt/kolla-kubernetes/tools/setup-resolv-conf.sh kolla
## Build all Helm microcharts, service charts, and metacharts
echo "Build all Helm microcharts, service charts, and metacharts"
/opt/kolla-kubernetes/tools/helm_build_all.sh /tmp/
@ -245,7 +240,6 @@ global:
base_distro: "centos"
install_type: "source"
tunnel_interface: $tunnel_interface
resolve_conf_net_host_workaround: true
kolla_kubernetes_external_subnet: $mgmt_subnet_size
kolla_kubernetes_external_vip: $keepalived_vip
kube_logger: false