validator.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. ###############################################################################
  3. # Pre upgrade checks for known data problems, if this playbook fails you should
  4. # contact support. If you're not supported contact users@lists.openshift.com
  5. #
  6. # oc_objectvalidator provides these two checks
  7. # 1 - SDN Data issues, never seen in the wild but known possible due to code audits
  8. # https://github.com/openshift/origin/issues/12697
  9. # 2 - Namespace protections, https://bugzilla.redhat.com/show_bug.cgi?id=1428934
  10. #
  11. ###############################################################################
  12. - name: Verify 3.5 specific upgrade checks
  13. hosts: oo_first_master
  14. roles:
  15. - { role: lib_openshift }
  16. tasks:
  17. - name: Check for invalid namespaces and SDN errors
  18. oc_objectvalidator:
  19. # What's all this PetSet business about?
  20. #
  21. # 'PetSets' were ALPHA resources in Kube <= 3.4. In >= 3.5 they are
  22. # no longer supported. The BETA resource 'StatefulSets' replaces
  23. # them. We can't migrate clients PetSets to
  24. # StatefulSets. Additionally, Red Hat has never officially supported
  25. # these resource types. Sorry users, but if you were using
  26. # unsupported resources from the Kube documentation then we can't
  27. # help you at this time.
  28. #
  29. # Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1428229
  30. - name: Check if legacy PetSets exist
  31. oc_obj:
  32. state: list
  33. all_namespaces: true
  34. kind: petsets
  35. register: l_do_petsets_exist
  36. - name: Fail on unsupported resource migration 'PetSets'
  37. fail:
  38. msg: >
  39. PetSet objects were detected in your cluster. These are an
  40. Alpha feature in upstream Kubernetes 1.4 and are not supported
  41. by Red Hat. In Kubernetes 1.5, they are replaced by the Beta
  42. feature StatefulSets. Red Hat currently does not offer support
  43. for either PetSets or StatefulSets.
  44. Automatically migrating PetSets to StatefulSets in OpenShift
  45. Container Platform (OCP) 3.5 is not supported. See the
  46. Kubernetes "Upgrading from PetSets to StatefulSets"
  47. documentation for additional information:
  48. https://kubernetes.io/docs/tasks/manage-stateful-set/upgrade-pet-set-to-stateful-set/
  49. PetSets MUST be removed before upgrading to OCP 3.5. Red Hat
  50. strongly recommends reading the above referenced documentation
  51. in its entirety before taking any destructive actions.
  52. If you want to simply remove all PetSets without manually
  53. migrating to StatefulSets, run this command as a user with
  54. cluster-admin privileges:
  55. $ oc get petsets --all-namespaces -o yaml | oc delete -f - --cascade=false
  56. when:
  57. # Search did not fail, valid resource type found
  58. - l_do_petsets_exist.results.returncode == 0
  59. # Items do exist in the search results
  60. - l_do_petsets_exist.results.results.0['items'] | length > 0