Browse Source

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
changes/52/507252/3
Kevin Fox 5 years ago
parent
commit
1d1a9c2177
  1. 11
      doc/source/deployment-guide.rst
  2. 1
      etc/kolla-kubernetes/kolla-kubernetes.yml
  3. 1
      helm/all_values.yaml
  4. 21
      helm/kolla-common/templates/_common_lib.yaml
  5. 1
      helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml
  6. 1
      helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml
  7. 1
      helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml
  8. 1
      helm/microservice/ironic-conductor-daemonset/templates/ironic-conductor.yaml
  9. 1
      helm/microservice/ironic-inspector-deployment/templates/ironic-inspector.yaml
  10. 1
      helm/microservice/iscsi-target-daemonset/templates/iscsi-target-daemonset.yaml
  11. 1
      helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml
  12. 1
      helm/microservice/keepalived-daemonset/templates/keepalived-daemonset.yaml
  13. 1
      helm/microservice/neutron-dhcp-agent-daemonset/templates/dhcp-agent-daemonset.yaml
  14. 1
      helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml
  15. 1
      helm/microservice/neutron-metadata-agent-daemonset/templates/metadata-agent-daemonset.yaml
  16. 1
      helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml
  17. 1
      helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml
  18. 1
      helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml
  19. 1
      helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml
  20. 1
      helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml
  21. 1
      helm/microservice/test-ceph-init-mon-job/templates/test_ceph_init_mon_job.yaml
  22. 1
      helm/microservice/test-ceph-init-osd-job/templates/test-ceph-init-osd-job.yaml
  23. 1
      helm/microservice/test-ceph-mon-daemonset/templates/test_ceph_mon_daemonset.yaml
  24. 1
      helm/microservice/test-ceph-osd-pod/templates/test-ceph-osd-pod.yaml
  25. 1
      helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml
  26. 1
      tests/conf/ceph-all-in-one/kolla_kubernetes_config
  27. 1
      tests/conf/iscsi-all-in-one/kolla_kubernetes_config
  28. 25
      tools/setup-resolv-conf.sh
  29. 1
      tools/setup_dev_env.sh
  30. 3
      tools/setup_gate_ceph.sh
  31. 3
      tools/setup_gate_common.sh
  32. 3
      tools/setup_gate_iscsi.sh
  33. 6
      tools/setup_kube_AIO.sh

11
doc/source/deployment-guide.rst

@ -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"

1
etc/kolla-kubernetes/kolla-kubernetes.yml

@ -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

1
helm/all_values.yaml

@ -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

21
helm/kolla-common/templates/_common_lib.yaml

@ -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" }}

1
helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml

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

1
helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml

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

1
helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml

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

1
helm/microservice/ironic-conductor-daemonset/templates/ironic-conductor.yaml

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

1
helm/microservice/ironic-inspector-deployment/templates/ironic-inspector.yaml

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

1
helm/microservice/iscsi-target-daemonset/templates/iscsi-target-daemonset.yaml

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

1
helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml

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

1
helm/microservice/keepalived-daemonset/templates/keepalived-daemonset.yaml

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

1
helm/microservice/neutron-dhcp-agent-daemonset/templates/dhcp-agent-daemonset.yaml

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

1
helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml

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

1
helm/microservice/neutron-metadata-agent-daemonset/templates/metadata-agent-daemonset.yaml

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

1
helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml

@ -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

1
helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml

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

1
helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml

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

1
helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml

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

1
helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml

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

1
helm/microservice/test-ceph-init-mon-job/templates/test_ceph_init_mon_job.yaml

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

1
helm/microservice/test-ceph-init-osd-job/templates/test-ceph-init-osd-job.yaml

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

1
helm/microservice/test-ceph-mon-daemonset/templates/test_ceph_mon_daemonset.yaml

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

1
helm/microservice/test-ceph-osd-pod/templates/test-ceph-osd-pod.yaml

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

1
helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml

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

1
tests/conf/ceph-all-in-one/kolla_kubernetes_config

@ -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"

1
tests/conf/iscsi-all-in-one/kolla_kubernetes_config

@ -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"

25
tools/setup-resolv-conf.sh

@ -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

1
tools/setup_dev_env.sh

@ -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 () {

3
tools/setup_gate_ceph.sh

@ -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 \

3
tools/setup_gate_common.sh

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

3
tools/setup_gate_iscsi.sh

@ -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 \

6
tools/setup_kube_AIO.sh

@ -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

Loading…
Cancel
Save