[Feature] Add default liveness/readiness probes to the generated Robin Deployment

Abierto
#84 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, kubernetes
Área
backend, cloud, devops

Línea de trabajo

The change is in internal/controller/redkey_robin.go, function buildDesiredRobinDeployment. Start by examining how the Robin container is built, particularly around the Ports/Resources block. Look at the existing override logic for SecurityContext/Resources from spec.robin.template to understand precedence. Write unit tests to verify default probes are added and user overrides work. Check drift detection in robinDeploymentNeedsUpdate to include probe fields. Ensure the dependent Robin health endpoint issue is resolved before merging.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

Depends on: redkey-robin issue "Expose an HTTP health endpoint (/healthz, /readyz) for Kubernetes probes". This issue should only be merged once Robin actually serves the health endpoint(s), otherwise the probes point to a non-existent endpoint and the kubelet will kill the pod in a crash loop.

Problem

The operator builds the Robin Deployment in buildDesiredRobinDeployment (internal/controller/redkey_robin.go) without any LivenessProbe or ReadinessProbe. A hung Robin is neither restarted nor flagged unless the user manually defines probes via spec.robin.template. This reduces resilience out of the box.

(The operator's own pod is unaffected — its manager already registers /healthz and /readyz and its Deployment defines probes. This issue is specifically about the Robin pod that the operator generates.)

Proposed solution

In buildDesiredRobinDeployment, set default probes on the Robin container pointing at the health endpoint exposed by Robin:

  • livenessProbe: HTTP GET /healthz on the metrics port (8080), with sensible initialDelaySeconds / periodSeconds / failureThreshold.
  • readinessProbe (optional but recommended for consistency): HTTP GET /readyz on the same port.
  • Defaults must remain overridable by spec.robin.template (block-replacement semantics, consistent with how resources/securityContext are already handled). If the user provides probes in the template, they win.

Acceptance criteria

  • Generated Robin Deployment includes a default livenessProbe (HTTP /healthz, port 8080).
  • Generated Robin Deployment includes a default readinessProbe (HTTP /readyz) — or documented decision to omit readiness.
  • Probe timings (initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold) are reasonable for a reconciler and documented.
  • User-supplied probes via spec.robin.template override the defaults.
  • Unit tests assert: defaults present when no template; template probes take precedence when provided.
  • Drift detection (robinDeploymentNeedsUpdate) accounts for the probe fields so the operator does not fight the Deployment controller.

Implementation notes

  • Add the probe defaults where the base container is constructed in buildDesiredRobinDeployment (internal/controller/redkey_robin.go, around the Ports/Resources block).
  • Honor the existing override precedence used for SecurityContext/Resources from spec.robin.template.spec.containers[0].
  • Verify probes are included in the fields compared by the deployment-drift check to keep reconciliation idempotent.

Related

Lenguaje dominante
Go
Estrellas
29
Forks
2
Merge medio
13 h 32 min
PR fusionados (30 d)
16

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InditexTech/redkey-operator

Todos los issues de InditexTech/redkey-operator

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.