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

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
go, kubernetes
Domain
backend, cloud, devops

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
Go
Stars
29
Forks
2
Avg merge
13h 32m
Merged PRs (30d)
16

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InditexTech/redkey-operator

All issues in InditexTech/redkey-operator

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.