Browse Source

In master bootstrapping mode, use the new openshift_control_plane role

Use static pod restarts everywhere, and remove openvswitch from nodes.
Clayton Coleman 7 năm trước cách đây
mục cha
commit
8c0ce4e740
33 tập tin đã thay đổi với 97 bổ sung237 xóa
  1. 9 0
      playbooks/common/openshift-cluster/upgrades/docker/tasks/restart.yml
  2. 8 0
      playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml
  3. 0 1
      playbooks/init/base_packages.yml
  4. 3 0
      playbooks/openshift-master/private/additional_config.yml
  5. 18 0
      playbooks/openshift-master/private/config.yml
  6. 6 11
      playbooks/openshift-master/private/scaleup.yml
  7. 5 10
      playbooks/openshift-master/private/tasks/wire_aggregator.yml
  8. 0 1
      roles/container_runtime/tasks/package_docker.yml
  9. 12 0
      roles/openshift_control_plane/files/scripts/docker/master-logs
  10. 12 0
      roles/openshift_control_plane/files/scripts/docker/master-restart
  11. 1 1
      roles/openshift_control_plane/handlers/main.yml
  12. 1 1
      roles/openshift_control_plane/tasks/restart.yml
  13. 1 1
      roles/openshift_control_plane/tasks/static_shim.yml
  14. 0 37
      roles/openshift_control_plane/tasks/upgrade_facts.yml
  15. 5 11
      roles/openshift_logging/handlers/main.yml
  16. 0 2
      roles/openshift_master/tasks/upgrade/rpm_upgrade.yml
  17. 5 11
      roles/openshift_metrics/handlers/main.yml
  18. 0 8
      roles/openshift_node/defaults/main.yml
  19. 0 22
      roles/openshift_node/handlers/main.yml
  20. 0 17
      roles/openshift_node/tasks/config.yml
  21. 0 8
      roles/openshift_node/tasks/config/install-ovs-docker-service-file.yml
  22. 0 8
      roles/openshift_node/tasks/config/install-ovs-service-env-file.yml
  23. 0 17
      roles/openshift_node/tasks/container_images.yml
  24. 0 3
      roles/openshift_node/tasks/main.yml
  25. 7 0
      roles/openshift_node/tasks/node_system_container.yml
  26. 0 22
      roles/openshift_node/tasks/openvswitch_system_container.yml
  27. 0 11
      roles/openshift_node/tasks/systemd_units.yml
  28. 1 1
      roles/openshift_node/tasks/upgrade/stop_services.yml
  29. 0 3
      roles/openshift_node/templates/node.service.j2
  30. 3 9
      roles/openshift_node/templates/openshift.docker.node.service
  31. 0 3
      roles/openshift_node/templates/openvswitch-avoid-oom.conf
  32. 0 17
      roles/openshift_node/templates/openvswitch.docker.service
  33. 0 1
      roles/openshift_node/templates/openvswitch.sysconfig.j2

+ 9 - 0
playbooks/common/openshift-cluster/upgrades/docker/tasks/restart.yml

@@ -6,6 +6,15 @@
   retries: 3
   delay: 30
 
+- name: Restart static master services
+  command: /usr/local/bin/master-restart "{{ item }}"
+  with_items:
+  - api
+  - controllers
+  - etcd
+  failed_when: false
+  when: openshift_is_containerized | bool
+
 - name: Restart containerized services
   service: name={{ item }} state=started
   with_items:

+ 8 - 0
playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml

@@ -12,6 +12,14 @@
   failed_when: false
   when: openshift_is_containerized | bool
 
+- name: Restart static master services
+  command: /usr/local/bin/master-restart "{{ item }}"
+  with_items:
+  - api
+  - controllers
+  - etcd
+  failed_when: false
+
 - name: Check Docker image count
   shell: "docker images -aq | wc -l"
   register: docker_image_count

+ 0 - 1
playbooks/init/base_packages.yml

@@ -35,7 +35,6 @@
       - >
         (openshift_use_system_containers | default(False)) | bool
         or (openshift_use_etcd_system_container | default(False)) | bool
-        or (openshift_use_openvswitch_system_container | default(False)) | bool
         or (openshift_use_node_system_container | default(False)) | bool
         or (openshift_use_master_system_container | default(False)) | bool
       register: result

+ 3 - 0
playbooks/openshift-master/private/additional_config.yml

@@ -18,6 +18,9 @@
     etcd_urls: "{{ openshift.master.etcd_urls }}"
     omc_cluster_hosts: "{{ groups.oo_masters | join(' ')}}"
   roles:
+  # TODO: this is currently required in order to schedule pods onto the masters, but
+  #   should be moved into components once nodes are using dynamic config
+  - role: openshift_sdn
   - role: openshift_project_request_template
     when: openshift_project_request_template_manage
   - role: openshift_examples

+ 18 - 0
playbooks/openshift-master/private/config.yml

@@ -176,6 +176,18 @@
     openshift_no_proxy_etcd_host_ips: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_etcd_to_config'] | default([]))
                                                 | lib_utils_oo_collect('openshift.common.ip') | default([]) | join(',')
                                                 }}"
+  pre_tasks:
+  # This will be moved into the control plane role once openshift_master is removed
+  - name: Add static pod and systemd shim commands
+    import_role:
+      name: openshift_control_plane
+      tasks_from: static_shim
+  - name: Prepare the bootstrap node config on masters for self-hosting
+    import_role:
+      name: openshift_node_group
+      tasks_from: bootstrap
+    when: openshift_master_bootstrap_enabled | default(false) | bool
+
   roles:
   - role: openshift_master_facts
   - role: openshift_clock
@@ -184,6 +196,8 @@
   - role: openshift_builddefaults
   - role: openshift_buildoverrides
   - role: nickhammond.logrotate
+
+  # DEPRECATED: begin moving away from this
   - role: openshift_master
     openshift_master_ha: "{{ (groups.oo_masters | length > 1) | bool }}"
     openshift_master_hosts: "{{ groups.oo_masters_to_config }}"
@@ -193,6 +207,10 @@
     openshift_master_default_registry_value: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value }}"
     openshift_master_default_registry_value_api: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_api }}"
     openshift_master_default_registry_value_controllers: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_controllers }}"
+    when: not ( openshift_master_bootstrap_enabled | default(false) | bool )
+
+  - role: openshift_control_plane
+    when: openshift_master_bootstrap_enabled | default(false) | bool
   - role: tuned
   - role: nuage_ca
     when: openshift_use_nuage | default(false) | bool

+ 6 - 11
playbooks/openshift-master/private/scaleup.yml

@@ -15,19 +15,14 @@
       yaml_key: 'kubernetesMasterConfig.masterCount'
       yaml_value: "{{ openshift.master.master_count }}"
     notify:
-    - restart master api
-    - restart master controllers
+    - restart master
   handlers:
-  - name: restart master api
-    service: name={{ openshift_service_type }}-master-controllers state=restarted
+  - name: restart master
+    command: /usr/local/bin/master-restart "{{ item }}"
+    with_items:
+    - api
+    - controllers
     notify: verify api server
-  # We retry the controllers because the API may not be 100% initialized yet.
-  - name: restart master controllers
-    command: "systemctl restart {{ openshift_service_type }}-master-controllers"
-    retries: 3
-    delay: 5
-    register: result
-    until: result.rc == 0
   - name: verify api server
     command: >
       curl --silent --tlsv1.2

+ 5 - 10
playbooks/openshift-master/private/tasks/wire_aggregator.yml

@@ -191,16 +191,11 @@
 #restart master serially here
 - when: yedit_output.changed or (yedit_asset_config_output is defined and yedit_asset_config_output.changed)
   block:
-  - name: restart master api
-    systemd: name={{ openshift_service_type }}-master-api state=restarted
-
-  # We retry the controllers because the API may not be 100% initialized yet.
-  - name: restart master controllers
-    command: "systemctl restart {{ openshift_service_type }}-master-controllers"
-    retries: 3
-    delay: 5
-    register: result
-    until: result.rc == 0
+  - name: restart master
+    command: /usr/local/bin/master-restart "{{ item }}"
+    with_items:
+    - api
+    - controllers
 
   - name: Verify API Server
     # Using curl here since the uri module requires python-httplib2 and

+ 0 - 1
roles/container_runtime/tasks/package_docker.yml

@@ -8,7 +8,6 @@
   - >
     (openshift_use_system_containers | default(False)) | bool
     or (openshift_use_etcd_system_container | default(False)) | bool
-    or (openshift_use_openvswitch_system_container | default(False)) | bool
     or (openshift_use_node_system_container | default(False)) | bool
     or (openshift_use_master_system_container | default(False)) | bool
 

+ 12 - 0
roles/openshift_control_plane/files/scripts/docker/master-logs

@@ -7,6 +7,18 @@ if [[ -z "${1-}" || -z "${2-}" ]]; then
   echo "A component name like 'api', 'etcd', or 'controllers' must be specified along with the container name within that component." 1>&2
   exit 1
 fi
+
+# container name is ignored for services
+for type in ( "atomic-openshift"  "origin" ); then
+  if systemctl cat "${type}-master-${1}.service" &>/dev/null; then
+    journalctl -u "${type}-master-${1}.service" "${@:3}"
+    exit 0
+  fi
+fi
+
+# TODO: move to cri-ctl
+# TODO: short term hack for cri-o
+
 uid=$(docker ps -l -a --filter "label=openshift.io/component=${1}" --filter "label=io.kubernetes.container.name=POD" --format '{{ .Label "io.kubernetes.pod.uid" }}')
 if [[ -z "${uid}" ]]; then
   echo "Component ${1} is stopped or not running" 1>&2

+ 12 - 0
roles/openshift_control_plane/files/scripts/docker/master-restart

@@ -6,6 +6,18 @@ if [[ -z "${1-}" ]]; then
   echo "A component name like 'api', 'etcd', or 'controllers' must be specified." 1>&2
   exit 1
 fi
+
+types=( "atomic-openshift" "origin" )
+for type in "${types[@]}"; do
+  if systemctl cat "${type}-master-${1}.service" &>/dev/null; then
+    systemctl restart "${type}-master-${1}.service"
+    exit 0
+  fi
+done
+
+# TODO: move to cri-ctl
+# TODO: short term hack for cri-o
+
 container=$(docker ps -l -q --filter "label=openshift.io/component=${1}" --filter "label=io.kubernetes.container.name=POD")
 if [[ -z "${container}" ]]; then
   echo "Component ${1} is already stopped" 1>&2

+ 1 - 1
roles/openshift_control_plane/handlers/main.yml

@@ -1,6 +1,6 @@
 ---
 - name: restart master
-  command: /usr/bin/master-restart "{{ item }}"
+  command: /usr/local/bin/master-restart "{{ item }}"
   with_items:
   - api
   - controllers

+ 1 - 1
roles/openshift_control_plane/tasks/restart.yml

@@ -1,6 +1,6 @@
 ---
 - name: restart master
-  command: /usr/bin/master-restart "{{ item }}"
+  command: /usr/local/bin/master-restart "{{ item }}"
   with_items:
   - api
   - controllers

+ 1 - 1
roles/openshift_control_plane/tasks/static_shim.yml

@@ -3,7 +3,7 @@
 - name: Copy static master scripts
   copy:
     src: "{{ item }}"
-    dest: "/usr/bin/"
+    dest: "/usr/local/bin/"
     mode: 0500
   with_items:
   - scripts/docker/master-logs

+ 0 - 37
roles/openshift_control_plane/tasks/upgrade_facts.yml

@@ -1,37 +0,0 @@
----
-# This file exists because we call systemd_units.yml from outside of the role
-# during upgrades.  When we remove this pattern, we can probably
-# eliminate most of these set_fact items.
-
-- name: Set openshift_master_config_dir if unset
-  set_fact:
-    openshift_master_config_dir: '/etc/origin/master'
-  when: openshift_master_config_dir is not defined
-
-- name: Set r_openshift_master_data_dir if unset
-  set_fact:
-    r_openshift_master_data_dir: "{{ openshift_data_dir | default('/var/lib/origin') }}"
-  when: r_openshift_master_data_dir is not defined
-
-- set_fact:
-    oreg_auth_credentials_path: "{{ r_openshift_master_data_dir }}/.docker"
-  when: oreg_auth_credentials_path is not defined
-
-- set_fact:
-    oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
-  when: oreg_host is not defined
-
-- set_fact:
-    oreg_auth_credentials_replace: False
-  when: oreg_auth_credentials_replace is not defined
-
-- name: Set openshift_master_debug_level
-  set_fact:
-    openshift_master_debug_level: "{{ debug_level | default(2) }}"
-  when:
-  - openshift_master_debug_level is not defined
-
-- name: Init HA Service Info
-  set_fact:
-    containerized_svc_dir: "{{ containerized_svc_dir | default('/usr/lib/systemd/system') }}"
-    ha_svc_template_path: "{{ ha_svc_template_path | default('native-cluster') }}"

+ 5 - 11
roles/openshift_logging/handlers/main.yml

@@ -1,18 +1,12 @@
 ---
-- name: restart master api
-  systemd: name={{ openshift_service_type }}-master-api state=restarted
+- name: restart master
+  command: /usr/local/bin/master-restart "{{ item }}"
+  with_items:
+  - api
+  - controllers
   when: (not (master_api_service_status_changed | default(false) | bool))
   notify: Verify API Server
 
-# We retry the controllers because the API may not be 100% initialized yet.
-- name: restart master controllers
-  command: "systemctl restart {{ openshift_service_type }}-master-controllers"
-  retries: 3
-  delay: 5
-  register: result
-  until: result.rc == 0
-  when: (not (master_controllers_service_status_changed | default(false) | bool))
-
 - name: Verify API Server
   # Using curl here since the uri module requires python-httplib2 and
   # wait_for port doesn't provide health information.

+ 0 - 2
roles/openshift_master/tasks/upgrade/rpm_upgrade.yml

@@ -17,7 +17,6 @@
       - "{{ openshift_service_type }}{{ openshift_pkg_version | default('') }}"
       - "{{ openshift_service_type }}-master{{ openshift_pkg_version | default('') }}"
       - "{{ openshift_service_type }}-node{{ openshift_pkg_version | default('') }}"
-      - "{{ openshift_service_type }}-sdn-ovs{{ openshift_pkg_version | default('') }}"
       - "{{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }}"
   register: result
   until: result is succeeded
@@ -32,7 +31,6 @@
       - "{{ openshift_service_type }}{{ openshift_pkg_version }}"
       - "{{ openshift_service_type }}-master{{ openshift_pkg_version }}"
       - "{{ openshift_service_type }}-node{{ openshift_pkg_version }}"
-      - "{{ openshift_service_type }}-sdn-ovs{{ openshift_pkg_version }}"
       - "{{ openshift_service_type }}-clients{{ openshift_pkg_version }}"
   register: result
   until: result is succeeded

+ 5 - 11
roles/openshift_metrics/handlers/main.yml

@@ -1,18 +1,12 @@
 ---
-- name: restart master api
-  systemd: name={{ openshift_service_type }}-master-api state=restarted
+- name: restart master
+  command: /usr/local/bin/master-restart "{{ item }}"
+  with_items:
+  - api
+  - controllers
   when: (not (master_api_service_status_changed | default(false) | bool))
   notify: Verify API Server
 
-# We retry the controllers because the API may not be 100% initialized yet.
-- name: restart master controllers
-  command: "systemctl restart {{ openshift_service_type }}-master-controllers"
-  retries: 3
-  delay: 5
-  register: result
-  until: result.rc == 0
-  when: (not (master_controllers_service_status_changed | default(false) | bool))
-
 - name: Verify API Server
   # Using curl here since the uri module requires python-httplib2 and
   # wait_for port doesn't provide health information.

+ 0 - 8
roles/openshift_node/defaults/main.yml

@@ -16,12 +16,6 @@ openshift_oreg_url_default_dict:
 openshift_oreg_url_default: "{{ openshift_oreg_url_default_dict[openshift_deployment_type] }}"
 oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) }}"
 
-osn_ovs_image_default_dict:
-  origin: "openshift/openvswitch"
-  openshift-enterprise: "openshift3/openvswitch"
-osn_ovs_image_default: "{{ osn_ovs_image_default_dict[openshift_deployment_type] }}"
-osn_ovs_image: "{{ osn_ovs_image_default }}"
-
 openshift_dns_ip: "{{ ansible_default_ipv4['address'] }}"
 
 openshift_node_env_vars: {}
@@ -113,8 +107,6 @@ system_images_registry_dict:
   origin: "docker.io"
 
 system_images_registry: "{{ system_images_registry_dict[openshift_deployment_type | default('origin')] }}"
-openshift_use_external_openvswitch: False
-l_is_openvswitch_system_container: "{{ (openshift_use_openvswitch_system_container | default(openshift_use_system_containers | default(false)) | bool) }}"
 
 openshift_image_tag: ''
 

+ 0 - 22
roles/openshift_node/handlers/main.yml

@@ -14,28 +14,6 @@
   when:
   - (not skip_node_svc_handlers | default(False) | bool)
 
-- name: restart openvswitch
-  systemd:
-    name: openvswitch
-    state: restarted
-  when:
-  - (not skip_node_svc_handlers | default(False) | bool)
-  - not (ovs_service_status_changed | default(false) | bool)
-  - openshift_node_use_openshift_sdn | bool
-  - not openshift_node_bootstrap
-  register: l_openshift_node_stop_openvswitch_result
-  until: not (l_openshift_node_stop_openvswitch_result is failed)
-  retries: 3
-  delay: 30
-  notify:
-  - restart openvswitch pause
-
-- name: restart openvswitch pause
-  pause: seconds=15
-  when:
-  - (not skip_node_svc_handlers | default(False) | bool)
-  - openshift_is_containerized | bool
-
 - name: restart node
   systemd:
     name: "{{ openshift_service_type }}-node"

+ 0 - 17
roles/openshift_node/tasks/config.yml

@@ -6,23 +6,6 @@
   include_tasks: container_images.yml
   when: openshift_is_containerized | bool
 
-- name: Start and enable openvswitch service
-  systemd:
-    name: openvswitch.service
-    enabled: yes
-    state: started
-    daemon_reload: yes
-  when:
-    - openshift_is_containerized | bool
-    - openshift_node_use_openshift_sdn | default(true) | bool
-  register: ovs_start_result
-  until: not (ovs_start_result is failed)
-  retries: 3
-  delay: 30
-
-- set_fact:
-    ovs_service_status_changed: "{{ ovs_start_result is changed }}"
-
 - file:
     dest: "{{ l2_openshift_node_kubelet_args['config'] }}"
     state: directory

+ 0 - 8
roles/openshift_node/tasks/config/install-ovs-docker-service-file.yml

@@ -1,8 +0,0 @@
----
-- name: Install OpenvSwitch docker service file
-  template:
-    dest: "/etc/systemd/system/openvswitch.service"
-    src: openvswitch.docker.service
-  notify:
-  - reload systemd units
-  - restart openvswitch

+ 0 - 8
roles/openshift_node/tasks/config/install-ovs-service-env-file.yml

@@ -1,8 +0,0 @@
----
-- name: Create the openvswitch service env file
-  template:
-    src: openvswitch.sysconfig.j2
-    dest: /etc/sysconfig/openvswitch
-  notify:
-  - reload systemd units
-  - restart openvswitch

+ 0 - 17
roles/openshift_node/tasks/container_images.yml

@@ -3,20 +3,3 @@
   include_tasks: node_system_container.yml
   when:
   - l_is_node_system_container | bool
-
-- name: Install OpenvSwitch system containers
-  include_tasks: openvswitch_system_container.yml
-  when:
-  - openshift_node_use_openshift_sdn | bool
-  - l_is_openvswitch_system_container | bool
-  - not openshift_use_external_openvswitch | bool
-
-- name: Pre-pull openvswitch image
-  command: >
-    docker pull {{ osn_ovs_image }}:{{ openshift_image_tag }}
-  register: pull_result
-  changed_when: "'Downloaded newer image' in pull_result.stdout"
-  when:
-  - openshift_node_use_openshift_sdn | bool
-  - not l_is_openvswitch_system_container | bool
-  - not openshift_use_external_openvswitch | bool

+ 0 - 3
roles/openshift_node/tasks/main.yml

@@ -77,6 +77,3 @@
   when: "'iscsi' in osn_storage_plugin_deps"
 
 ##### END Storage #####
-
-- include_tasks: config/workaround-bz1331590-ovs-oom-fix.yml
-  when: openshift_node_use_openshift_sdn | default(true) | bool

+ 7 - 0
roles/openshift_node/tasks/node_system_container.yml

@@ -11,6 +11,13 @@
   register: pull_result
   changed_when: "'Pulling layer' in pull_result.stdout"
 
+# TODO: remove when system container is fixed to not include it
+- name: Ensure old system path is set
+  file:
+    state: directory
+    path: "/etc/origin/openvswitch"
+    mode: '0750'
+
 - name: Install or Update node system container
   oc_atomic_container:
     name: "{{ openshift_service_type }}-node"

+ 0 - 22
roles/openshift_node/tasks/openvswitch_system_container.yml

@@ -1,22 +0,0 @@
----
-- set_fact:
-    l_service_name: "cri-o"
-  when: openshift_use_crio | bool
-
-- set_fact:
-    l_service_name: "{{ openshift_docker_service_name }}"
-  when: not openshift_use_crio | bool
-
-- name: Pre-pull OpenVSwitch system container image
-  command: >
-    atomic pull --storage=ostree {{ 'docker:' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ osn_ovs_image }}:{{ openshift_image_tag }}
-  register: pull_result
-  changed_when: "'Pulling layer' in pull_result.stdout"
-
-- name: Install or Update OpenVSwitch system container
-  oc_atomic_container:
-    name: openvswitch
-    image: "{{ 'docker:' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ osn_ovs_image }}:{{ openshift_image_tag }}"
-    state: latest
-    values:
-      - "DOCKER_SERVICE={{ l_service_name }}"

+ 0 - 11
roles/openshift_node/tasks/systemd_units.yml

@@ -18,16 +18,5 @@
   - name: include node deps docker service file
     include_tasks: config/install-node-deps-docker-service-file.yml
 
-  - name: include ovs service environment file
-    include_tasks: config/install-ovs-service-env-file.yml
-    when:
-    - not openshift_use_external_openvswitch | bool
-
-  - include_tasks: config/install-ovs-docker-service-file.yml
-    when:
-    - openshift_node_use_openshift_sdn | bool
-    - not l_is_openvswitch_system_container | bool
-    - not openshift_use_external_openvswitch | bool
-
 - include_tasks: config/configure-node-settings.yml
 - include_tasks: config/configure-proxy-settings.yml

+ 1 - 1
roles/openshift_node/tasks/upgrade/stop_services.yml

@@ -12,7 +12,7 @@
   failed_when: false
 
 - name: Ensure static containerized services stopped before Docker restart
-  command: /usr/bin/master-restart "{{ item }}"
+  command: /usr/local/bin/master-restart "{{ item }}"
   with_items:
   - api
   - controllers

+ 0 - 3
roles/openshift_node/templates/node.service.j2

@@ -3,9 +3,6 @@ Description=OpenShift Node
 After={{ openshift_docker_service_name }}.service
 After=chronyd.service
 After=ntpd.service
-Wants=openvswitch.service
-After=ovsdb-server.service
-After=ovs-vswitchd.service
 Wants={{ openshift_docker_service_name }}.service
 Documentation=https://github.com/openshift/origin
 Wants=dnsmasq.service

+ 3 - 9
roles/openshift_node/templates/openshift.docker.node.service

@@ -3,15 +3,8 @@ After={{ openshift_service_type }}-master.service
 After={{ openshift_docker_service_name }}.service
 After=chronyd.service
 After=ntpd.service
-After=openvswitch.service
 PartOf={{ openshift_docker_service_name }}.service
 Requires={{ openshift_docker_service_name }}.service
-{% if openshift_node_use_openshift_sdn %}
-Wants=openvswitch.service
-PartOf=openvswitch.service
-After=ovsdb-server.service
-After=ovs-vswitchd.service
-{% endif %}
 Wants={{ openshift_service_type }}-master.service
 Requires={{ openshift_service_type }}-node-dep.service
 After={{ openshift_service_type }}-node-dep.service
@@ -26,6 +19,7 @@ ExecStartPre=/usr/bin/cp /etc/origin/node/node-dnsmasq.conf /etc/dnsmasq.d/
 ExecStartPre=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:/in-addr.arpa/127.0.0.1,/{{ openshift.common.dns_domain }}/127.0.0.1
 ExecStart=/usr/bin/docker run --name {{ openshift_service_type }}-node \
   --rm --privileged --net=host --pid=host --env-file=/etc/sysconfig/{{ openshift_service_type }}-node \
+  --entrypoint /usr/local/bin/openshift-node \
   -v /:/rootfs:ro,rslave -e CONFIG_FILE=${CONFIG_FILE} -e OPTIONS=${OPTIONS} -e DEBUG_LOGLEVEL=${DEBUG_LOGLEVEL}\
   -e HOST=/rootfs -e HOST_ETC=/host-etc \
   -v {{ openshift_node_data_dir }}:{{ openshift_node_data_dir }}:rslave \
@@ -34,8 +28,8 @@ ExecStart=/usr/bin/docker run --name {{ openshift_service_type }}-node \
   -v /etc/localtime:/etc/localtime:ro -v /etc/machine-id:/etc/machine-id:ro \
   -v /run:/run -v /sys:/sys:rw -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
   -v /usr/bin/docker:/usr/bin/docker:ro -v /var/lib/docker:/var/lib/docker \
-  -v /lib/modules:/lib/modules -v /etc/origin/openvswitch:/etc/openvswitch \
-  -v /etc/origin/sdn:/etc/openshift-sdn -v /var/lib/cni:/var/lib/cni \
+  -v /lib/modules:/lib/modules \
+  -v /etc/cni:/etc/cni:ro -v /opt/cni:/opt/cni:ro \
   -v /etc/systemd/system:/host-etc/systemd/system -v /var/log:/var/log \
   {% if openshift_use_nuage | default(false) -%} $NUAGE_ADDTL_BIND_MOUNTS {% endif -%} \
   -v /dev:/dev $DOCKER_ADDTL_BIND_MOUNTS -v /etc/pki:/etc/pki:ro \

+ 0 - 3
roles/openshift_node/templates/openvswitch-avoid-oom.conf

@@ -1,3 +0,0 @@
-# Avoid the OOM killer for openvswitch and it's children:
-[Service]
-OOMScoreAdjust=-1000

+ 0 - 17
roles/openshift_node/templates/openvswitch.docker.service

@@ -1,17 +0,0 @@
-[Unit]
-After={{ openshift_docker_service_name }}.service
-Requires={{ openshift_docker_service_name }}.service
-PartOf={{ openshift_docker_service_name }}.service
-
-[Service]
-EnvironmentFile=/etc/sysconfig/openvswitch
-ExecStartPre=-/usr/bin/docker rm -f openvswitch
-ExecStart=/usr/bin/docker run --name openvswitch --rm --privileged --net=host --pid=host -v /lib/modules:/lib/modules -v /run:/run -v /sys:/sys:ro -v /etc/origin/openvswitch:/etc/openvswitch {{ osn_ovs_image }}:${IMAGE_VERSION}
-ExecStartPost=/usr/bin/sleep 5
-ExecStop=/usr/bin/docker stop openvswitch
-SyslogIdentifier=openvswitch
-Restart=always
-RestartSec=5s
-
-[Install]
-WantedBy={{ openshift_docker_service_name }}.service

+ 0 - 1
roles/openshift_node/templates/openvswitch.sysconfig.j2

@@ -1 +0,0 @@
-IMAGE_VERSION={{ openshift_image_tag }}