diff --git a/crates/api/Dockerfile b/crates/api/Dockerfile index db98fb4..c711ad6 100644 --- a/crates/api/Dockerfile +++ b/crates/api/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1-slim AS builder +FROM rust:1.88-slim AS builder WORKDIR /app diff --git a/crates/indexer/Dockerfile b/crates/indexer/Dockerfile index 69b995e..90a0fcc 100644 --- a/crates/indexer/Dockerfile +++ b/crates/indexer/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1-slim AS builder +FROM rust:1.88-slim AS builder WORKDIR /app diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 5873f37..9072100 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -1,6 +1,3 @@ -version: \ -3.9\ - # Development compose — runs only the infrastructure dependencies. # The indexer and API service are run locally (cargo run / go run) so that # code changes reflect immediately without rebuilding containers. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c46f6ed..58a317f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - # Production compose — runs all four services. # All secrets are passed via environment variables; never hardcode values here. diff --git a/helm/trident/templates/grpc-api-deployment.yaml b/helm/trident/templates/grpc-api-deployment.yaml index c375372..44636e3 100644 --- a/helm/trident/templates/grpc-api-deployment.yaml +++ b/helm/trident/templates/grpc-api-deployment.yaml @@ -35,6 +35,10 @@ spec: secretKeyRef: name: {{ .Values.global.existingSecret }} key: REDIS_URL + livenessProbe: + {{- toYaml .Values.grpcApi.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.grpcApi.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.grpcApi.resources | nindent 12 }} {{- with .Values.grpcApi.nodeSelector }} diff --git a/helm/trident/templates/indexer-deployment.yaml b/helm/trident/templates/indexer-deployment.yaml index 5553d0d..89a15df 100644 --- a/helm/trident/templates/indexer-deployment.yaml +++ b/helm/trident/templates/indexer-deployment.yaml @@ -21,6 +21,10 @@ spec: - name: indexer image: "{{ .Values.indexer.image.repository }}:{{ .Values.indexer.image.tag }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} + ports: + - name: metrics + containerPort: {{ .Values.indexer.metricsPort }} + protocol: TCP env: - name: DATABASE_URL valueFrom: @@ -36,6 +40,10 @@ spec: - name: {{ $k }} value: {{ $v | quote }} {{- end }} + livenessProbe: + {{- toYaml .Values.indexer.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.indexer.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.indexer.resources | nindent 12 }} {{- with .Values.indexer.nodeSelector }} diff --git a/helm/trident/templates/nginx-deployment.yaml b/helm/trident/templates/nginx-deployment.yaml index f098d7a..797aa96 100644 --- a/helm/trident/templates/nginx-deployment.yaml +++ b/helm/trident/templates/nginx-deployment.yaml @@ -58,6 +58,10 @@ spec: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf + livenessProbe: + {{- toYaml .Values.nginx.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.nginx.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.nginx.resources | nindent 12 }} volumes: diff --git a/helm/trident/values.yaml b/helm/trident/values.yaml index 2d82e4f..7775ea8 100644 --- a/helm/trident/values.yaml +++ b/helm/trident/values.yaml @@ -29,6 +29,25 @@ indexer: env: # GRPC_ADDR of the Rust gRPC service (in-cluster DNS) GRPC_ADDR: "trident-grpc-api:5000" + # Prometheus metrics server (METRICS_PORT, default 9090) doubles as the + # liveness/readiness signal for this otherwise portless worker. + metricsPort: 9090 + livenessProbe: + httpGet: + path: /metrics + port: 9090 + initialDelaySeconds: 15 + periodSeconds: 20 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + httpGet: + path: /metrics + port: 9090 + initialDelaySeconds: 10 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 nodeSelector: {} tolerations: [] affinity: {} @@ -43,6 +62,20 @@ grpcApi: replicaCount: 1 service: port: 5000 + livenessProbe: + tcpSocket: + port: 5000 + initialDelaySeconds: 10 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + tcpSocket: + port: 5000 + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 3 + timeoutSeconds: 2 resources: requests: cpu: "250m" @@ -112,6 +145,20 @@ nginx: service: type: LoadBalancer port: 80 + livenessProbe: + tcpSocket: + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + tcpSocket: + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 resources: requests: cpu: "50m"