committed by
Kubernetes Prow Robot
14 changed files with 163 additions and 23 deletions
Unified View
Diff Options
-
4docs/ha-mode.md
-
10inventory/sample/group_vars/all/all.yml
-
14roles/download/defaults/main.yml
-
6roles/kubernetes/node/defaults/main.yml
-
25roles/kubernetes/node/tasks/haproxy.yml
-
7roles/kubernetes/node/tasks/main.yml
-
7roles/kubernetes/node/tasks/nginx-proxy.yml
-
43roles/kubernetes/node/templates/haproxy.cfg.j2
-
43roles/kubernetes/node/templates/manifests/haproxy.manifest.j2
-
10roles/kubernetes/node/templates/manifests/nginx-proxy.manifest.j2
-
8roles/kubernetes/node/templates/nginx.conf.j2
-
6roles/kubespray-defaults/defaults/main.yaml
-
2roles/network_plugin/contiv/tasks/main.yml
-
1tests/files/gce_ubuntu-flannel-ha.yml
@ -0,0 +1,25 @@ |
|||||
|
--- |
||||
|
- name: haproxy | Cleanup potentially deployed nginx-proxy |
||||
|
file: |
||||
|
path: "{{ kube_manifest_dir }}/nginx-proxy.yml" |
||||
|
state: absent |
||||
|
|
||||
|
- name: haproxy | Write static pod |
||||
|
template: |
||||
|
src: manifests/haproxy.manifest.j2 |
||||
|
dest: "{{ kube_manifest_dir }}/haproxy.yml" |
||||
|
|
||||
|
- name: haproxy | Make haproxy directory |
||||
|
file: |
||||
|
path: "{{ haproxy_config_dir }}" |
||||
|
state: directory |
||||
|
mode: 0700 |
||||
|
owner: root |
||||
|
|
||||
|
- name: haproxy | Write haproxy configuration |
||||
|
template: |
||||
|
src: haproxy.cfg.j2 |
||||
|
dest: "{{ haproxy_config_dir }}/haproxy.cfg" |
||||
|
owner: root |
||||
|
mode: 0755 |
||||
|
backup: yes |
@ -0,0 +1,43 @@ |
|||||
|
global |
||||
|
maxconn 4000 |
||||
|
log 127.0.0.1 local0 |
||||
|
|
||||
|
defaults |
||||
|
mode http |
||||
|
log global |
||||
|
option httplog |
||||
|
option dontlognull |
||||
|
option http-server-close |
||||
|
option redispatch |
||||
|
retries 5 |
||||
|
timeout http-request 5m |
||||
|
timeout queue 5m |
||||
|
timeout connect 30s |
||||
|
timeout client 15m |
||||
|
timeout server 15m |
||||
|
timeout http-keep-alive 30s |
||||
|
timeout check 30s |
||||
|
maxconn 4000 |
||||
|
|
||||
|
{% if loadbalancer_apiserver_healthcheck_port is defined -%} |
||||
|
frontend healthz |
||||
|
bind *:{{ loadbalancer_apiserver_healthcheck_port }} |
||||
|
mode http |
||||
|
monitor-uri /healthz |
||||
|
{% endif %} |
||||
|
|
||||
|
frontend kube_api_frontend |
||||
|
bind *:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }} |
||||
|
mode tcp |
||||
|
option tcplog |
||||
|
default_backend kube_api_backend |
||||
|
|
||||
|
backend kube_api_backend |
||||
|
mode tcp |
||||
|
balance leastconn |
||||
|
default-server inter 15s downinter 15s rise 2 fall 2 slowstart 60s maxconn 1000 maxqueue 256 weight 100 |
||||
|
option httpchk GET /healthz |
||||
|
http-check expect status 200 |
||||
|
{% for host in groups['kube-master'] -%} |
||||
|
server {{ host }} {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(fallback_ips[host])) }}:{{ kube_apiserver_port }} check check-ssl verify none |
||||
|
{% endfor -%} |
@ -0,0 +1,43 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: Pod |
||||
|
metadata: |
||||
|
name: haproxy |
||||
|
namespace: kube-system |
||||
|
labels: |
||||
|
addonmanager.kubernetes.io/mode: Reconcile |
||||
|
k8s-app: kube-haproxy |
||||
|
spec: |
||||
|
hostNetwork: true |
||||
|
nodeSelector: |
||||
|
beta.kubernetes.io/os: linux |
||||
|
{% if kube_version is version('v1.11.1', '>=') %} |
||||
|
priorityClassName: system-node-critical |
||||
|
{% endif %} |
||||
|
containers: |
||||
|
- name: haproxy |
||||
|
image: {{ haproxy_image_repo }}:{{ haproxy_image_tag }} |
||||
|
imagePullPolicy: {{ k8s_image_pull_policy }} |
||||
|
resources: |
||||
|
requests: |
||||
|
cpu: {{ loadbalancer_apiserver_cpu_requests }} |
||||
|
memory: {{ loadbalancer_apiserver_memory_requests }} |
||||
|
securityContext: |
||||
|
privileged: true |
||||
|
{% if loadbalancer_apiserver_healthcheck_port is defined -%} |
||||
|
livenessProbe: |
||||
|
httpGet: |
||||
|
path: /healthz |
||||
|
port: {{ loadbalancer_apiserver_healthcheck_port }} |
||||
|
readinessProbe: |
||||
|
httpGet: |
||||
|
path: /healthz |
||||
|
port: {{ loadbalancer_apiserver_healthcheck_port }} |
||||
|
{% endif -%} |
||||
|
volumeMounts: |
||||
|
- mountPath: /usr/local/etc/haproxy/ |
||||
|
name: etc-haproxy |
||||
|
readOnly: true |
||||
|
volumes: |
||||
|
- name: etc-haproxy |
||||
|
hostPath: |
||||
|
path: {{ haproxy_config_dir }} |
Write
Preview
Loading…
Cancel
Save