Merge pull request #1186 from holser/resolv_conf

Set ClusterFirstWithHostNet for Pods with hostnetwork: true
This commit is contained in:
Matthew Mosesohn 2017-04-04 20:49:55 +03:00 committed by GitHub
commit f8cf6b4f7c
6 changed files with 14 additions and 1 deletions

View file

@ -4,7 +4,7 @@
dest: "{{kube_config_dir}}/{{item.file}}"
with_items:
- {file: netchecker-agent-ds.yml, type: ds, name: netchecker-agent}
- {file: netchecker-agent-hostnet-ds.yml, type: ds, name: netchecker-agent-hostnet}
- {file: netchecker-agent-hostnet-ds.j2, type: ds, name: netchecker-agent-hostnet}
- {file: netchecker-server-pod.yml, type: po, name: netchecker-server}
- {file: netchecker-server-svc.yml, type: svc, name: netchecker-service}
register: manifests

View file

@ -13,6 +13,9 @@ spec:
app: netchecker-agent-hostnet
spec:
hostNetwork: True
{%- if kube_version | version_compare('v1.6', '>=') -%}
dnsPolicy: ClusterFirstWithHostNet
{%- endif -%}
containers:
- name: netchecker-agent
image: "{{ agent_img }}"

View file

@ -8,6 +8,9 @@ metadata:
kargo: v2
spec:
hostNetwork: true
{% if kube_version | version_compare('v1.6', '>=') %}
dnsPolicy: ClusterFirstWithHostNet
{% endif %}
containers:
- name: kube-apiserver
image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}

View file

@ -7,6 +7,9 @@ metadata:
k8s-app: kube-controller
spec:
hostNetwork: true
{%- if kube_version | version_compare('v1.6', '>=') -%}
dnsPolicy: ClusterFirstWithHostNet
{%- endif -%}
containers:
- name: kube-controller-manager
image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}

View file

@ -7,6 +7,9 @@ metadata:
k8s-app: kube-scheduler
spec:
hostNetwork: true
{%- if kube_version | version_compare('v1.6', '>=') -%}
dnsPolicy: ClusterFirstWithHostNet
{%- endif -%}
containers:
- name: kube-scheduler
image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}

View file

@ -11,6 +11,7 @@
-v /etc/cni:/etc/cni:ro \
-v /opt/cni:/opt/cni:ro \
-v /etc/ssl:/etc/ssl:ro \
-v /etc/resolv.conf:/etc/resolv.conf \
{% for dir in ssl_ca_dirs -%}
-v {{ dir }}:{{ dir }}:ro \
{% endfor -%}