cluster_ip_test.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. suite: service clusterIP test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with type ClusterIP
  6. set:
  7. service:
  8. my-service:
  9. enabled: true
  10. primary: true
  11. type: ClusterIP
  12. ports:
  13. port-name:
  14. enabled: true
  15. primary: true
  16. port: 12345
  17. workload:
  18. my-workload:
  19. enabled: true
  20. primary: true
  21. type: Deployment
  22. podSpec: {}
  23. asserts:
  24. - documentIndex: &serviceDoc 1
  25. isKind:
  26. of: Service
  27. - documentIndex: *serviceDoc
  28. isAPIVersion:
  29. of: v1
  30. - documentIndex: *serviceDoc
  31. equal:
  32. path: metadata.name
  33. value: release-name-common-test
  34. - documentIndex: *serviceDoc
  35. equal:
  36. path: spec
  37. value:
  38. type: ClusterIP
  39. publishNotReadyAddresses: false
  40. ports:
  41. - name: port-name
  42. port: 12345
  43. protocol: TCP
  44. targetPort: 12345
  45. selector:
  46. app.kubernetes.io/instance: RELEASE-NAME
  47. app.kubernetes.io/name: common-test
  48. pod.name: my-workload
  49. - it: should pass with type ClusterIP and available options set
  50. set:
  51. some_policy: PreferDualStack
  52. some_family: IPv6
  53. some_ip: 172.16.20.35
  54. some_other_ip: 10.200.34.53
  55. some_affinity: ClientIP
  56. some_timeout: 100
  57. some_port: 12344
  58. some_target_port: 12346
  59. some_protocol: http
  60. service:
  61. my-service:
  62. enabled: true
  63. primary: true
  64. type: ClusterIP
  65. clusterIP: "{{ .Values.some_ip }}"
  66. publishNotReadyAddresses: true
  67. ipFamilyPolicy: "{{ .Values.some_policy }}"
  68. ipFamilies:
  69. - IPv4
  70. - "{{ .Values.some_family }}"
  71. externalIPs:
  72. - "{{ .Values.some_other_ip }}"
  73. - 10.200.34.54
  74. sessionAffinity: "{{ .Values.some_affinity }}"
  75. sessionAffinityConfig:
  76. clientIP:
  77. timeoutSeconds: "{{ .Values.some_timeout }}"
  78. ports:
  79. port-name:
  80. enabled: true
  81. primary: true
  82. port: 12345
  83. port-name2:
  84. enabled: true
  85. port: "{{ .Values.some_port }}"
  86. targetPort: "{{ .Values.some_target_port }}"
  87. protocol: "{{ .Values.some_protocol }}"
  88. workload:
  89. my-workload:
  90. enabled: true
  91. primary: true
  92. type: Deployment
  93. podSpec: {}
  94. asserts:
  95. - documentIndex: *serviceDoc
  96. equal:
  97. path: spec
  98. value:
  99. type: ClusterIP
  100. clusterIP: 172.16.20.35
  101. ipFamilyPolicy: PreferDualStack
  102. publishNotReadyAddresses: true
  103. ipFamilies:
  104. - IPv4
  105. - IPv6
  106. externalIPs:
  107. - 10.200.34.53
  108. - 10.200.34.54
  109. sessionAffinity: ClientIP
  110. sessionAffinityConfig:
  111. clientIP:
  112. timeoutSeconds: 100
  113. ports:
  114. - name: port-name
  115. port: 12345
  116. protocol: TCP
  117. targetPort: 12345
  118. - name: port-name2
  119. port: 12344
  120. protocol: TCP
  121. targetPort: 12346
  122. selector:
  123. app.kubernetes.io/instance: RELEASE-NAME
  124. app.kubernetes.io/name: common-test
  125. pod.name: my-workload