Skip to content
Snippets Groups Projects
Unverified Commit 9f2dd096 authored by Etienne Champetier's avatar Etienne Champetier Committed by GitHub
Browse files

Add proxy support to containerd, improves no_proxy (#5583)


* containerd: add proxy support

Signed-off-by: default avatarEtienne Champetier <champetier.etienne@gmail.com>

* kubespray-defaults: add kube_service_addresses / kube_pods_subnet to no_proxy

CIDR notation in no_proxy is supported by a lot of programs/languages,
including go: https://github.com/golang/go/issues/16704


Without that containerd cannot talk the the API server (kube_apiserver_ip),
but it should not go through an external proxy for the nodes/pods/services

Signed-off-by: default avatarEtienne Champetier <champetier.etienne@gmail.com>
parent 2798adc8
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,18 @@ ...@@ -26,6 +26,18 @@
- include_tasks: containerd_repo.yml - include_tasks: containerd_repo.yml
- name: Create containerd service systemd directory if it doesn't exist
file:
path: /etc/systemd/system/containerd.service.d
state: directory
- name: Write containerd proxy drop-in
template:
src: http-proxy.conf.j2
dest: /etc/systemd/system/containerd.service.d/http-proxy.conf
notify: restart containerd
when: http_proxy is defined or https_proxy is defined
- name: ensure containerd config directory - name: ensure containerd config directory
file: file:
dest: "{{ containerd_cfg_dir }}" dest: "{{ containerd_cfg_dir }}"
......
[Service]
Environment={% if http_proxy is defined %}"HTTP_PROXY={{ http_proxy }}"{% endif %} {% if https_proxy is defined %}"HTTPS_PROXY={{ https_proxy }}"{% endif %} {% if no_proxy is defined %}"NO_PROXY={{ no_proxy }}"{% endif %}
...@@ -416,7 +416,7 @@ no_proxy: >- ...@@ -416,7 +416,7 @@ no_proxy: >-
{%- if additional_no_proxy is defined -%} {%- if additional_no_proxy is defined -%}
{{ additional_no_proxy }}, {{ additional_no_proxy }},
{%- endif -%} {%- endif -%}
127.0.0.1,localhost 127.0.0.1,localhost,{{kube_service_addresses}},{{kube_pods_subnet}}
{%- endif %} {%- endif %}
proxy_env: proxy_env:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment