Merge pull request #969 from mattymo/port_reserve

Prevent dynamic port allocation in nodePort range
pull/990/head
Matthew Mosesohn 2017-02-07 18:24:57 +03:00 committed by GitHub
commit 491074aab1
2 changed files with 14 additions and 0 deletions

View File

@ -29,3 +29,7 @@ nginx_image_repo: nginx
nginx_image_tag: 1.11.4-alpine
etcd_config_dir: /etc/ssl/etcd
# A port range to reserve for services with NodePort visibility.
# Inclusive at both ends of the range.
kube_apiserver_node_port_range: "30000-32767"

View File

@ -21,6 +21,16 @@
notify: restart kubelet
tags: kubelet
- name: Ensure nodePort range is reserved
sysctl:
name: net.ipv4.ip_local_reserved_ports
value: "{{ kube_apiserver_node_port_range }}"
sysctl_set: yes
state: present
reload: yes
when: kube_apiserver_node_port_range is defined
tags: kube-proxy
- name: Write proxy manifest
template:
src: manifests/kube-proxy.manifest.j2