2021-08-04 04:46:07 -07:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2021-10-28 04:48:43 -07:00
|
|
|
name: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
labels:
|
2021-10-28 04:48:43 -07:00
|
|
|
app: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
spec:
|
|
|
|
ports:
|
2021-10-28 04:48:43 -07:00
|
|
|
- port: 4343
|
|
|
|
name: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
protocol: TCP
|
2022-11-25 07:35:32 -08:00
|
|
|
- port: 3000
|
|
|
|
name: metrics
|
2021-08-04 04:46:07 -07:00
|
|
|
clusterIP: None
|
|
|
|
selector:
|
2021-10-28 04:48:43 -07:00
|
|
|
app: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
2021-10-28 04:48:43 -07:00
|
|
|
name: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2021-10-28 04:48:43 -07:00
|
|
|
app: p2w-attest
|
|
|
|
serviceName: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
replicas: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2021-10-28 04:48:43 -07:00
|
|
|
app: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
spec:
|
|
|
|
restartPolicy: Always
|
|
|
|
terminationGracePeriodSeconds: 0
|
|
|
|
containers:
|
2021-10-28 04:48:43 -07:00
|
|
|
- name: p2w-attest
|
|
|
|
image: p2w-attest
|
2021-08-04 04:46:07 -07:00
|
|
|
command:
|
|
|
|
- python3
|
|
|
|
- /usr/src/pyth/p2w_autoattest.py
|
2022-02-23 10:12:16 -08:00
|
|
|
env:
|
2022-11-24 05:14:29 -08:00
|
|
|
- name: P2W_INITIALIZE_SOL_CONTRACT
|
|
|
|
value: "1"
|
|
|
|
- name: P2W_EXIT_ON_ERROR
|
|
|
|
value: "true"
|
2021-08-04 04:46:07 -07:00
|
|
|
tty: true
|
2022-12-15 09:29:23 -08:00
|
|
|
# Probes, in order of appearance https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
|
|
|
|
#
|
|
|
|
# Startup probe - delays other probes until it gets its first success
|
|
|
|
startupProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /healthcheck
|
|
|
|
port: 3000
|
|
|
|
failureThreshold: 100 # up to 100 * 10 seconds to report initial healthy status
|
|
|
|
periodSeconds: 10
|
|
|
|
# Readiness probe - Used to tell load balancers to
|
|
|
|
# start/stop sending traffic to the container, *without*
|
|
|
|
# restarting it. The attester does not accept any traffic as
|
|
|
|
# part of its workflow, which means this isn't very useful.
|
|
|
|
# readinessProbe:
|
|
|
|
# httpGet:
|
|
|
|
# path: /healthcheck
|
|
|
|
# port: 3000
|
|
|
|
# failureThreshold: 1
|
|
|
|
# periodSeconds: 10
|
|
|
|
#
|
|
|
|
# Liveness probe - decides restarts for misbehaving
|
|
|
|
# containers
|
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /healthcheck
|
|
|
|
port: 3000
|
|
|
|
failureThreshold: 1 # If the attester healthcheck fails once,
|
|
|
|
periodSeconds: 10
|
|
|
|
|
2021-10-28 04:48:43 -07:00
|
|
|
ports:
|
|
|
|
- containerPort: 4343
|
|
|
|
name: p2w-attest
|
|
|
|
protocol: TCP
|
2022-11-25 07:35:32 -08:00
|
|
|
- containerPort: 3000
|
|
|
|
name: metrics
|
|
|
|
protocol: TCP
|