client-daemonset.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. apiVersion: apps/v1
  2. kind: DaemonSet
  3. metadata:
  4. name: multus-validation-test-client-{{ .NodeType }}-{{ .ClientType }}-{{ .ClientID }}
  5. labels:
  6. app: multus-validation-test-client
  7. nodeType: "{{ .NodeType }}"
  8. clientType: "{{ .ClientType }}"
  9. clientID: "{{ .ClientID }}"
  10. app.kubernetes.io/name: "client"
  11. app.kubernetes.io/instance: "client-{{ .NodeType }}-{{ .ClientType }}-{{ .ClientID }}"
  12. app.kubernetes.io/component: "client"
  13. app.kubernetes.io/part-of: "multus-validation-test"
  14. app.kubernetes.io/managed-by: "rook-cli"
  15. spec:
  16. selector:
  17. matchLabels:
  18. app: multus-validation-test-client
  19. nodeType: "{{ .NodeType }}"
  20. clientType: "{{ .ClientType }}"
  21. clientID: "{{ .ClientID }}"
  22. template:
  23. metadata:
  24. labels:
  25. app: multus-validation-test-client
  26. nodeType: "{{ .NodeType }}"
  27. clientType: "{{ .ClientType }}"
  28. clientID: "{{ .ClientID }}"
  29. annotations:
  30. k8s.v1.cni.cncf.io/networks: "{{ .NetworksAnnotationValue }}"
  31. spec:
  32. nodeSelector:
  33. {{- range $k, $v := .Placement.NodeSelector }}
  34. {{ $k }}: {{ $v }}
  35. {{- end }}
  36. tolerations:
  37. {{- range $idx, $toleration := .Placement.Tolerations }}
  38. - {{ $toleration.ToJSON }}
  39. {{- end }}
  40. securityContext:
  41. runAsNonRoot: true
  42. seccompProfile:
  43. type: RuntimeDefault
  44. containers:
  45. {{ $NginxImage := .NginxImage }} # base context not available in range below
  46. {{ range $name, $address := .NetworkNamesAndAddresses }}
  47. - name: readiness-check-web-server-{{ $name }}-addr
  48. # use nginx image because it's already used for the web server pod and has a non-root user
  49. image: "{{ $NginxImage }}"
  50. command:
  51. - sleep
  52. - infinity
  53. resources: {}
  54. securityContext:
  55. allowPrivilegeEscalation: false
  56. capabilities:
  57. drop:
  58. - "ALL"
  59. # A readiness probe makes validation testing easier than investigate container logs.
  60. # Additionally, readiness probe failures don't result in CrashLoopBackoff -- ideal here,
  61. # where ever-longer back-offs would cause tests to run for much longer than necessary.
  62. readinessProbe:
  63. # Low failure threshold and high success threshold. Intended to be very sensitive to
  64. # failures. If probe fails with any regularity, Ceph OSDs likely won't be stable.
  65. failureThreshold: 1
  66. successThreshold: 12
  67. periodSeconds: 5
  68. # Assumption: a network with a latency more than 4 seconds for this validation test's
  69. # simple client-server response likely won't support acceptable performance for any
  70. # production Ceph cluster.
  71. timeoutSeconds: 4
  72. # TODO: exec:curl works but httpGet fails. Why? need custom header?
  73. exec:
  74. command:
  75. - "curl"
  76. - "--insecure"
  77. - "{{ $address }}:8080"
  78. {{ end }}