Prechádzať zdrojové kódy

Remove containerized lb support

This commit removes all support for containerized load balancers.
Michael Gugino 7 rokov pred
rodič
commit
11b9915f7b

+ 0 - 12
playbooks/openshift-loadbalancer/private/config.yml

@@ -15,18 +15,6 @@
 
 - name: Configure load balancers
   hosts: oo_lb_to_config
-  vars:
-    openshift_loadbalancer_frontends: "{{ (openshift_master_api_port
-                                           | lib_utils_oo_loadbalancer_frontends(hostvars | lib_utils_oo_select_keys(groups['oo_masters']),
-                                                                                 openshift_use_nuage | default(false),
-                                                                                 nuage_mon_rest_server_port | default(none)))
-                                           + openshift_loadbalancer_additional_frontends | default([]) }}"
-    openshift_loadbalancer_backends: "{{ (openshift_master_api_port
-                                          | lib_utils_oo_loadbalancer_backends(hostvars | lib_utils_oo_select_keys(groups['oo_masters']),
-                                                                               openshift_use_nuage | default(false),
-                                                                               nuage_mon_rest_server_port | default(none)))
-                                          + openshift_loadbalancer_additional_backends | default([]) }}"
-    openshift_image_tag: "{{ hostvars[groups.oo_masters_to_config.0].openshift_image_tag }}"
   roles:
   - role: openshift_facts
   - role: openshift_loadbalancer

+ 10 - 19
roles/openshift_loadbalancer/defaults/main.yml

@@ -2,25 +2,16 @@
 r_openshift_loadbalancer_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
 r_openshift_loadbalancer_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
 
-openshift_router_image_default_dict:
-  origin: 'openshift/origin-haproxy-router'
-  openshift-enterprise: 'openshift3/ose-haproxy-router'
-openshift_router_image_default: "{{ openshift_router_image_default_dict[openshift_deployment_type] }}"
-openshift_router_image: "{{ openshift_router_image_default }}"
-
-haproxy_frontends:
-- name: main
-  binds:
-  - "*:{{ openshift_master_api_port }}"
-  default_backend: default
-
-haproxy_backends:
-- name: default
-  balance: roundrobin
-  servers:
-  - name: web01
-    address: 127.0.0.1:9000
-    opts: check
+openshift_loadbalancer_frontends: "{{ (openshift_master_api_port
+                                       | lib_utils_oo_loadbalancer_frontends(hostvars | lib_utils_oo_select_keys(groups['oo_masters']),
+                                                                             openshift_use_nuage | default(false),
+                                                                             nuage_mon_rest_server_port | default(none)))
+                                       + openshift_loadbalancer_additional_frontends | default([]) }}"
+openshift_loadbalancer_backends: "{{ (openshift_master_api_port
+                                      | lib_utils_oo_loadbalancer_backends(hostvars | lib_utils_oo_select_keys(groups['oo_masters']),
+                                                                           openshift_use_nuage | default(false),
+                                                                           nuage_mon_rest_server_port | default(none)))
+                                      + openshift_loadbalancer_additional_backends | default([]) }}"
 
 r_openshift_loadbalancer_os_firewall_deny: []
 r_openshift_loadbalancer_os_firewall_allow:

+ 5 - 22
roles/openshift_loadbalancer/tasks/main.yml

@@ -1,36 +1,21 @@
 ---
+- name: Fail if atomic
+  fail:
+    msg: "Load balancers on atomic host are no longer supported"
+  when: openshift_is_atomic
+
 - name: setup firewall
   import_tasks: firewall.yml
 
 - name: Install haproxy
   package: name=haproxy state=present
-  when: not openshift_is_containerized | bool
   register: result
   until: result is succeeded
 
-- name: Pull haproxy image
-  command: >
-    docker pull {{ openshift_router_image }}:{{ openshift_image_tag }}
-  when: openshift_is_containerized | bool
-
-- name: Create config directory for haproxy
-  file:
-    path: /etc/haproxy
-    state: directory
-  when: openshift_is_containerized | bool
-
-- name: Create the systemd unit files
-  template:
-    src: "haproxy.docker.service.j2"
-    dest: "/etc/systemd/system/haproxy.service"
-  when: openshift_is_containerized | bool
-  notify: restart haproxy
-
 - name: Configure systemd service directory for haproxy
   file:
     path: /etc/systemd/system/haproxy.service.d
     state: directory
-  when: not openshift_is_containerized | bool
 
 # Work around ini_file create option in 2.2 which defaults to no
 - name: Create limits.conf file
@@ -41,7 +26,6 @@
     owner: root
     group: root
   changed_when: false
-  when: not openshift_is_containerized | bool
 
 - name: Configure the nofile limits for haproxy
   ini_file:
@@ -50,7 +34,6 @@
     option: LimitNOFILE
     value: "{{ openshift_loadbalancer_limit_nofile | default(100000) }}"
   notify: restart haproxy
-  when: not openshift_is_containerized | bool
 
 - name: Configure haproxy
   template:

+ 0 - 19
roles/openshift_loadbalancer/templates/haproxy.docker.service.j2

@@ -1,19 +0,0 @@
-[Unit]
-After={{ openshift_docker_service_name }}.service
-After=chronyd.service
-After=ntpd.service
-Requires={{ openshift_docker_service_name }}.service
-PartOf={{ openshift_docker_service_name }}.service
-
-[Service]
-ExecStartPre=-/usr/bin/docker rm -f openshift_loadbalancer
-ExecStart=/usr/bin/docker run --rm --name openshift_loadbalancer {% for frontend in openshift_loadbalancer_frontends %} {% for bind in frontend.binds %} -p {{ bind |regex_replace('^[^:]*:(\d+).*$', '\\1') }}:{{ bind |regex_replace('^[^:]*:(\d+).*$', '\\1') }} {% endfor %} {% endfor %} -v /etc/haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro --entrypoint=haproxy {{ openshift_router_image }}:{{ openshift_image_tag }} -f /etc/haproxy/haproxy.cfg
-ExecStartPost=/usr/bin/sleep 10
-ExecStop=/usr/bin/docker stop openshift_loadbalancer
-LimitNOFILE={{ openshift_loadbalancer_limit_nofile | default(100000) }}
-LimitCORE=infinity
-Restart=always
-RestartSec=5s
-
-[Install]
-WantedBy={{ openshift_docker_service_name }}.service