node_port_test.yaml 3.8 KB

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