topology_spread_constaints_test.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. suite: test global topologySpreadConstraints
  3. templates:
  4. - cert-controller-deployment.yaml
  5. - deployment.yaml
  6. - webhook-deployment.yaml
  7. tests:
  8. - it: should set topologySpreadConstraints to set value if given
  9. set:
  10. global.topologySpreadConstraints:
  11. - maxSkew: 1
  12. topologyKey: kubernetes.io/hostname
  13. whenUnsatisfiable: DoNotSchedule
  14. matchLabelKeys:
  15. - pod-template-hash
  16. asserts:
  17. - isSubset:
  18. path: spec.template.spec.topologySpreadConstraints[0]
  19. content:
  20. maxSkew: 1
  21. topologyKey: kubernetes.io/hostname
  22. ---
  23. suite: test global topologySpreadConstraints on deployment.yaml
  24. templates:
  25. - deployment.yaml
  26. tests:
  27. - it: should set topologySpreadConstraints to set value if given
  28. set:
  29. global.topologySpreadConstraints:
  30. - maxSkew: 1
  31. topologyKey: kubernetes.io/hostname
  32. whenUnsatisfiable: DoNotSchedule
  33. matchLabelKeys:
  34. - pod-template-hash
  35. asserts:
  36. - isSubset:
  37. path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels
  38. content:
  39. app.kubernetes.io/name: external-secrets
  40. app.kubernetes.io/instance: RELEASE-NAME
  41. ---
  42. suite: test global topologySpreadConstraints on cert-controller-deployment.yaml
  43. templates:
  44. - cert-controller-deployment.yaml
  45. tests:
  46. - it: should set topologySpreadConstraints to set value if given
  47. set:
  48. global.topologySpreadConstraints:
  49. - maxSkew: 1
  50. topologyKey: kubernetes.io/hostname
  51. whenUnsatisfiable: DoNotSchedule
  52. matchLabelKeys:
  53. - pod-template-hash
  54. asserts:
  55. - isSubset:
  56. path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels
  57. content:
  58. app.kubernetes.io/name: external-secrets-cert-controller
  59. app.kubernetes.io/instance: RELEASE-NAME
  60. ---
  61. suite: test global topologySpreadConstraints on webhook-deployment.yaml
  62. templates:
  63. - webhook-deployment.yaml
  64. tests:
  65. - it: should set topologySpreadConstraints to set value if given
  66. set:
  67. global.topologySpreadConstraints:
  68. - maxSkew: 1
  69. topologyKey: kubernetes.io/hostname
  70. whenUnsatisfiable: DoNotSchedule
  71. matchLabelKeys:
  72. - pod-template-hash
  73. asserts:
  74. - isSubset:
  75. path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels
  76. content:
  77. app.kubernetes.io/name: external-secrets-webhook
  78. app.kubernetes.io/instance: RELEASE-NAME