p2w-attest.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: p2w-attest
  6. labels:
  7. app: p2w-attest
  8. spec:
  9. ports:
  10. - port: 4343
  11. name: p2w-attest
  12. protocol: TCP
  13. - port: 3000
  14. name: metrics
  15. clusterIP: None
  16. selector:
  17. app: p2w-attest
  18. ---
  19. apiVersion: apps/v1
  20. kind: StatefulSet
  21. metadata:
  22. name: p2w-attest
  23. spec:
  24. selector:
  25. matchLabels:
  26. app: p2w-attest
  27. serviceName: p2w-attest
  28. replicas: 1
  29. template:
  30. metadata:
  31. labels:
  32. app: p2w-attest
  33. spec:
  34. restartPolicy: Always
  35. terminationGracePeriodSeconds: 0
  36. containers:
  37. - name: p2w-attest
  38. image: p2w-attest
  39. command:
  40. - python3
  41. - /usr/src/pyth/p2w_autoattest.py
  42. env:
  43. - name: P2W_INITIALIZE_SOL_CONTRACT
  44. value: "1"
  45. - name: P2W_EXIT_ON_ERROR
  46. value: "true"
  47. tty: true
  48. # Probes, in order of appearance https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
  49. #
  50. # Startup probe - delays other probes until it gets its first success
  51. startupProbe:
  52. httpGet:
  53. path: /healthcheck
  54. port: 3000
  55. failureThreshold: 100 # up to 100 * 10 seconds to report initial healthy status
  56. periodSeconds: 10
  57. # Readiness probe - Used to tell load balancers to
  58. # start/stop sending traffic to the container, *without*
  59. # restarting it. The attester does not accept any traffic as
  60. # part of its workflow, which means this isn't very useful.
  61. # readinessProbe:
  62. # httpGet:
  63. # path: /healthcheck
  64. # port: 3000
  65. # failureThreshold: 1
  66. # periodSeconds: 10
  67. #
  68. # Liveness probe - decides restarts for misbehaving
  69. # containers
  70. livenessProbe:
  71. httpGet:
  72. path: /healthcheck
  73. port: 3000
  74. failureThreshold: 1 # If the attester healthcheck fails once,
  75. periodSeconds: 10
  76. ports:
  77. - containerPort: 4343
  78. name: p2w-attest
  79. protocol: TCP
  80. - containerPort: 3000
  81. name: metrics
  82. protocol: TCP