Browse Source

crio: Add schedulable check for dockergc-ds

Per review request this change adds a check to ensure there are
schedulable nodes that the dockergc-ds would execute on.
Steve Milner 7 years ago
parent
commit
f3e7c8a5e6
2 changed files with 9 additions and 1 deletions
  1. 1 1
      inventory/hosts.example
  2. 8 0
      roles/openshift_docker_gc/tasks/main.yaml

+ 1 - 1
inventory/hosts.example

@@ -166,7 +166,7 @@ debug_level=2
 # Enable docker garbage collection when using cri-o
 #openshift_crio_enable_docker_gc=True
 # Node Selectors to run the garbage collection
-#openshift_crio_docker_gc_node_selector: {'runtime': 'cri-o'}
+#openshift_crio_docker_gc_node_selector={'runtime': 'cri-o'}
 
 # Items added, as is, to end of /etc/sysconfig/docker OPTIONS
 # Default value: "--log-driver=journald"

+ 8 - 0
roles/openshift_docker_gc/tasks/main.yaml

@@ -1,4 +1,12 @@
 ---
+- name: Ensure that docker-gc will have nodes to run on
+  import_role:
+    name: openshift_master
+    tasks_from: ensure_nodes_matching_selector.yml
+  vars:
+    openshift_master_ensure_nodes_selector: "{{ r_docker_gc_node_selectors }}"
+    openshift_master_ensure_nodes_service: docker-gc daemonset
+
 - name: Create docker-gc tempdir
   command: mktemp -d
   register: templates_tmpdir