feat: improvements to k8s-based deployments#1556
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR migrates Taskfile minikube tasks to kind, updates deployment docs, standardizes kustomize label/image blocks, adds Postgres readiness initContainers and API probes, modifies eda-ui for TLS/config mounts and ports, updates Postgres image, and removes the legacy eda_kube script. ChangesKind Deployment Automation & Script Replacement
Documentation Updates
Kustomize Standardization & Image Configuration
Kubernetes Deployment Configuration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
tools/deploy/eda-scheduler/deployment.yaml (1)
25-28:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical: Database hostname mismatch in connection configuration.
The
EDA_DATABASE_URLon Line 26 references@postgres, whileEDA_DB_HOSTon Line 28 and the init container on Line 46 both useeda-postgres. This inconsistency will cause connection failures.🐛 Proposed fix to align database hostnames
- name: EDA_DATABASE_URL - value: postgresql+asyncpg://postgres:secret@postgres/eda + value: postgresql+asyncpg://postgres:secret@eda-postgres/eda - name: EDA_DB_HOST value: eda-postgres🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/deploy/eda-scheduler/deployment.yaml` around lines 25 - 28, The EDA_DATABASE_URL environment variable currently uses host "postgres" while EDA_DB_HOST (and the init container) use "eda-postgres", causing a hostname mismatch; update the EDA_DATABASE_URL value to use eda-postgres (i.e., change postgresql+asyncpg://postgres:secret@postgres/eda to postgresql+asyncpg://postgres:secret@eda-postgres/eda) so it matches EDA_DB_HOST and the init container configuration in deployment.yaml.tools/deploy/eda-api/deployment.yaml (1)
29-32:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical: Database hostname mismatch in connection configuration.
The
EDA_DATABASE_URLon Line 30 references@postgres, whileEDA_DB_HOSTon Line 32 and the init container on Line 66 both useeda-postgres. This inconsistency will cause connection failures.🐛 Proposed fix to align database hostnames
- name: EDA_DATABASE_URL - value: postgresql+asyncpg://postgres:secret@postgres/eda + value: postgresql+asyncpg://postgres:secret@eda-postgres/eda - name: EDA_DB_HOST value: eda-postgres🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/deploy/eda-api/deployment.yaml` around lines 29 - 32, The EDA_DATABASE_URL value uses the wrong hostname (`@postgres`) causing a mismatch with EDA_DB_HOST and the init container; update the EDA_DATABASE_URL environment variable to use the same host name used elsewhere (replace `@postgres` with `@eda-postgres`) so EDA_DATABASE_URL, EDA_DB_HOST and the init container reference the identical host name.tools/deploy/eda-default-worker/deployment.yaml (1)
25-28:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical: Database hostname mismatch in connection configuration.
The
EDA_DATABASE_URLon Line 26 references@postgres, whileEDA_DB_HOSTon Line 28 and the init container on Line 57 both useeda-postgres. This inconsistency will cause connection failures.🐛 Proposed fix to align database hostnames
- name: EDA_DATABASE_URL - value: postgresql+asyncpg://postgres:secret@postgres/eda + value: postgresql+asyncpg://postgres:secret@eda-postgres/eda - name: EDA_DB_HOST value: eda-postgres🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/deploy/eda-default-worker/deployment.yaml` around lines 25 - 28, The EDA_DATABASE_URL environment value uses host "postgres" while EDA_DB_HOST (and the init container) uses "eda-postgres", causing a mismatch; update the EDA_DATABASE_URL value to use the same host as EDA_DB_HOST (change "postgres" to "eda-postgres") or parameterize both to the same variable so the database hostname is consistent across EDA_DATABASE_URL, EDA_DB_HOST and the init container configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Taskfile.dist.yaml`:
- Around line 252-255: The kind:clean:api task's label selector ('comp in
(worker, api, scheduler)') currently omits pods labeled comp: activation-worker;
to include activation-worker update the label selector used in the
kind:clean:api task so it matches activation-worker as well (e.g., add
activation-worker into the comp list) in the task definition for kind:clean:api
to ensure activation-worker pods are restarted when performing the clean API
restart.
In `@tools/deploy/eda-api/deployment.yaml`:
- Around line 45-52: The EDA_ANSIBLE_BASE_JWT_KEY environment variable is set to
a URL placeholder ("https://localhost") which likely should be a JWT signing key
or a reference to a Secret; verify if EDA_ANSIBLE_BASE_JWT_KEY is intentionally
a URL or replace it with a proper secret reference (e.g., point
EDA_ANSIBLE_BASE_JWT_KEY to a Kubernetes Secret key) and ensure
EDA_RESOURCE_SERVER__URL and EDA_RESOURCE_SERVER__SECRET_KEY placeholders remain
as intended for dev/staging; update the deployment.yaml entries for
EDA_ANSIBLE_BASE_JWT_KEY (and optionally EDA_RESOURCE_SERVER__URL /
EDA_RESOURCE_SERVER__SECRET_KEY) to use the correct secret or value if they are
not intentional.
In `@tools/deploy/eda-ui/deployment.yaml`:
- Around line 27-28: The EDA_SERVER_UUID environment variable is hardcoded to
"edgecafe-beef-feed-fade-decadeedgecafe" which can cause identifier collisions;
update the deployment so EDA_SERVER_UUID is not a static secret: either document
that this value is a dev/test placeholder or change the manifest to inject a
generated/unique value at deploy time (e.g., templating, Kubernetes secret, or
downward API) and update any code that reads EDA_SERVER_UUID to handle
missing/rotated values; specifically modify the env entry for EDA_SERVER_UUID in
deployment.yaml to source the UUID from a deploy-time template/secret rather
than the literal string.
---
Outside diff comments:
In `@tools/deploy/eda-api/deployment.yaml`:
- Around line 29-32: The EDA_DATABASE_URL value uses the wrong hostname
(`@postgres`) causing a mismatch with EDA_DB_HOST and the init container; update
the EDA_DATABASE_URL environment variable to use the same host name used
elsewhere (replace `@postgres` with `@eda-postgres`) so EDA_DATABASE_URL,
EDA_DB_HOST and the init container reference the identical host name.
In `@tools/deploy/eda-default-worker/deployment.yaml`:
- Around line 25-28: The EDA_DATABASE_URL environment value uses host "postgres"
while EDA_DB_HOST (and the init container) uses "eda-postgres", causing a
mismatch; update the EDA_DATABASE_URL value to use the same host as EDA_DB_HOST
(change "postgres" to "eda-postgres") or parameterize both to the same variable
so the database hostname is consistent across EDA_DATABASE_URL, EDA_DB_HOST and
the init container configuration.
In `@tools/deploy/eda-scheduler/deployment.yaml`:
- Around line 25-28: The EDA_DATABASE_URL environment variable currently uses
host "postgres" while EDA_DB_HOST (and the init container) use "eda-postgres",
causing a hostname mismatch; update the EDA_DATABASE_URL value to use
eda-postgres (i.e., change postgresql+asyncpg://postgres:secret@postgres/eda to
postgresql+asyncpg://postgres:secret@eda-postgres/eda) so it matches EDA_DB_HOST
and the init container configuration in deployment.yaml.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 3b0e1e73-a1c1-4e6c-8c38-0bc6be7cad1f
📒 Files selected for processing (17)
Taskfile.dist.yamldocs/deployment.mddocs/development.mdscripts/eda_kube.shtools/deploy/eda-activation-worker/deployment.yamltools/deploy/eda-activation-worker/kustomization.yamltools/deploy/eda-api/deployment.yamltools/deploy/eda-api/kustomization.yamltools/deploy/eda-default-worker/deployment.yamltools/deploy/eda-default-worker/kustomization.yamltools/deploy/eda-scheduler/deployment.yamltools/deploy/eda-scheduler/kustomization.yamltools/deploy/eda-ui/deployment.yamltools/deploy/eda-ui/kustomization.yamltools/deploy/kustomization.yamltools/deploy/postgres/kustomization.yamltools/deploy/redis/kustomization.yaml
💤 Files with no reviewable changes (1)
- scripts/eda_kube.sh
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1556 +/- ##
=======================================
Coverage 92.17% 92.17%
=======================================
Files 244 244
Lines 11214 11214
=======================================
Hits 10337 10337
Misses 877 877
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
b6766a4 to
3f5ecde
Compare
There was a problem hiding this comment.
I think we should set EDA_MODE=development on this. Given Kind should be used only for dev environments, it only makes sense, and we benefit from the configuration that already exists for development scenarios (e.g. DEBUG=True, ALLOW_LOCAL_RESOURCE_MANAGEMENT=True), by only setting this to development mode.
This way, we could also remove the redundant placeholder env vars in the API deployment, for example, EDA_ANSIBLE_BASE_JWT_KEY, EDA_RESOURCE_SERVER__*, as development_defaults.py handles them.
EDA_MODE=development
3f5ecde to
cac3e68
Compare
@kaiokmo good points, I have added your suggestions. Please review again. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/deploy/eda-api/deployment.yaml`:
- Around line 69-70: The init container is using an unpinned, non-existent image
name (`image: postgresql`); change it to the official Postgres image and pin a
specific tag (e.g., `postgres:15.4` or another project-approved version) so
startup is reproducible. Update the `image:` value in the init container spec
(the same block containing the `command: [ 'sh', '-c', "until pg_isready -h
eda-postgres -p 5432; do ...` ]`) to use the fully qualified, version-pinned
image (for example `postgres:15.4`) and ensure any imagePullPolicy or registry
configuration matches your cluster policy.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 8ce0aefe-5120-43c4-ad4c-9abafd066ddd
📒 Files selected for processing (19)
Taskfile.dist.yamldocs/deployment.mddocs/development.mdscripts/eda_kube.shtools/deploy/eda-activation-worker/deployment.yamltools/deploy/eda-activation-worker/kustomization.yamltools/deploy/eda-api/deployment.yamltools/deploy/eda-api/kustomization.yamltools/deploy/eda-default-worker/deployment.yamltools/deploy/eda-default-worker/kustomization.yamltools/deploy/eda-scheduler/deployment.yamltools/deploy/eda-scheduler/kustomization.yamltools/deploy/eda-ui/deployment.yamltools/deploy/eda-ui/kustomization.yamltools/deploy/environment.properties.exampletools/deploy/kustomization.yamltools/deploy/postgres/deployment.yamltools/deploy/postgres/kustomization.yamltools/deploy/redis/kustomization.yaml
💤 Files with no reviewable changes (1)
- scripts/eda_kube.sh
✅ Files skipped from review due to trivial changes (4)
- tools/deploy/postgres/deployment.yaml
- docs/development.md
- tools/deploy/eda-default-worker/kustomization.yaml
- tools/deploy/eda-api/kustomization.yaml
🚧 Files skipped from review as they are similar to previous changes (10)
- tools/deploy/redis/kustomization.yaml
- tools/deploy/kustomization.yaml
- tools/deploy/eda-activation-worker/deployment.yaml
- tools/deploy/postgres/kustomization.yaml
- tools/deploy/eda-scheduler/deployment.yaml
- tools/deploy/eda-default-worker/deployment.yaml
- tools/deploy/eda-activation-worker/kustomization.yaml
- tools/deploy/eda-scheduler/kustomization.yaml
- Taskfile.dist.yaml
- tools/deploy/eda-ui/deployment.yaml
cac3e68 to
14428d8
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Taskfile.dist.yaml`:
- Around line 225-226: Update the built and loaded image name to match the
kustomize override by replacing the image tag "aap-eda:latest" used in the build
command and the kind load command with "localhost/aap-eda:latest"; specifically
modify the lines containing the build invocation "{{.CONTAINER_ENGINE}} build -t
aap-eda:latest -f tools/docker/Dockerfile ." and the kind load invocation "kind
load docker-image aap-eda:latest --name ${KIND_CLUSTER_NAME:-kind}" so both use
"localhost/aap-eda:latest" to ensure Kind nodes have the expected image.
In `@tools/deploy/eda-api/deployment.yaml`:
- Around line 53-64: Add a startupProbe to the container spec to avoid liveness
restarts during bootstrap: create a startupProbe using an httpGet to path
/_healthz and port 8000 (same endpoint as readiness/liveness), set a longer
initialDelaySeconds than liveness (e.g. 120s), and sensible
periodSeconds/failureThreshold (e.g. periodSeconds 10, failureThreshold 30) so
the probe allows time for migrations/setup before livenessProbe (refer to
readinessProbe and livenessProbe entries) begins enforcing restarts.
In `@tools/deploy/eda-ui/kustomization.yaml`:
- Around line 15-16: Replace the mutable image tag by changing the kustomization
setting newTag from "latest" to "main" so the UI image reference
quay.io/ansible/eda-ui:main is pinned for reproducible deploys; update the
newTag value in the kustomization entry (newName/newTag block) accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 89361ec1-cb19-43bd-bbf2-049160a402a2
📒 Files selected for processing (19)
Taskfile.dist.yamldocs/deployment.mddocs/development.mdscripts/eda_kube.shtools/deploy/eda-activation-worker/deployment.yamltools/deploy/eda-activation-worker/kustomization.yamltools/deploy/eda-api/deployment.yamltools/deploy/eda-api/kustomization.yamltools/deploy/eda-default-worker/deployment.yamltools/deploy/eda-default-worker/kustomization.yamltools/deploy/eda-scheduler/deployment.yamltools/deploy/eda-scheduler/kustomization.yamltools/deploy/eda-ui/deployment.yamltools/deploy/eda-ui/kustomization.yamltools/deploy/environment.properties.exampletools/deploy/kustomization.yamltools/deploy/postgres/deployment.yamltools/deploy/postgres/kustomization.yamltools/deploy/redis/kustomization.yaml
💤 Files with no reviewable changes (1)
- scripts/eda_kube.sh
✅ Files skipped from review due to trivial changes (3)
- tools/deploy/postgres/deployment.yaml
- tools/deploy/environment.properties.example
- tools/deploy/kustomization.yaml
14428d8 to
dacb05c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/deploy/eda-api/deployment.yaml`:
- Around line 64-68: The livenessProbe currently calls HTTP GET /_healthz which
invokes HealthView (that calls connection.ensure_connection() and can return 500
on OperationalError), so transient DB outages can restart the pod; change the
livenessProbe to a process-level check instead (use tcpSocket on port 8000) and
keep DB-dependent checks in startupProbe/readinessProbe. Update the
deployment.yaml livenessProbe block to remove the httpGet /_healthz and replace
it with a tcpSocket on port 8000, leaving any existing
readinessProbe/startupProbe that target /_healthz (or add them if missing) so
connection.ensure_connection() and OperationalError handling remain only in
readiness/startup checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 2ad5d8d9-dabc-4c2d-a102-3705fb6b41b3
📒 Files selected for processing (19)
Taskfile.dist.yamldocs/deployment.mddocs/development.mdscripts/eda_kube.shtools/deploy/eda-activation-worker/deployment.yamltools/deploy/eda-activation-worker/kustomization.yamltools/deploy/eda-api/deployment.yamltools/deploy/eda-api/kustomization.yamltools/deploy/eda-default-worker/deployment.yamltools/deploy/eda-default-worker/kustomization.yamltools/deploy/eda-scheduler/deployment.yamltools/deploy/eda-scheduler/kustomization.yamltools/deploy/eda-ui/deployment.yamltools/deploy/eda-ui/kustomization.yamltools/deploy/environment.properties.exampletools/deploy/kustomization.yamltools/deploy/postgres/deployment.yamltools/deploy/postgres/kustomization.yamltools/deploy/redis/kustomization.yaml
💤 Files with no reviewable changes (1)
- scripts/eda_kube.sh
✅ Files skipped from review due to trivial changes (4)
- tools/deploy/environment.properties.example
- tools/deploy/kustomization.yaml
- tools/deploy/eda-api/kustomization.yaml
- docs/development.md
dacb05c to
5926e47
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Taskfile.dist.yaml`:
- Line 11: The Taskfile sets CONTAINER_ENGINE default to "podman" but never pins
kind's provider, so kind may pick a different runtime; update Taskfile.dist.yaml
to set KIND_EXPERIMENTAL_PROVIDER to the same value as CONTAINER_ENGINE (use the
CONTAINER_ENGINE variable interpolation) so commands like kind load docker-image
and kind create/delete cluster use the same provider; locate the
CONTAINER_ENGINE definition and add or update KIND_EXPERIMENTAL_PROVIDER to
reference CONTAINER_ENGINE (ensure the variable name matches exactly) so kind
and the image build/runtime are consistent.
In `@tools/deploy/eda-ui/deployment.yaml`:
- Around line 36-37: The deployment sets imagePullPolicy: IfNotPresent for the
eda-ui container which can leave kind nodes using a stale image when you
override the eda-ui image with a mutable tag (newTag: latest for
quay.io/ansible/eda-ui); change the imagePullPolicy for the eda-ui container in
deployment.yaml from IfNotPresent to Always (or alternatively pin the image by
digest in your kustomize image override) so local clusters always pull the
latest image on redeploy.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: f8053997-a521-48e7-83ed-785d03746d60
📒 Files selected for processing (19)
Taskfile.dist.yamldocs/deployment.mddocs/development.mdscripts/eda_kube.shtools/deploy/eda-activation-worker/deployment.yamltools/deploy/eda-activation-worker/kustomization.yamltools/deploy/eda-api/deployment.yamltools/deploy/eda-api/kustomization.yamltools/deploy/eda-default-worker/deployment.yamltools/deploy/eda-default-worker/kustomization.yamltools/deploy/eda-scheduler/deployment.yamltools/deploy/eda-scheduler/kustomization.yamltools/deploy/eda-ui/deployment.yamltools/deploy/eda-ui/kustomization.yamltools/deploy/environment.properties.exampletools/deploy/kustomization.yamltools/deploy/postgres/deployment.yamltools/deploy/postgres/kustomization.yamltools/deploy/redis/kustomization.yaml
💤 Files with no reviewable changes (1)
- scripts/eda_kube.sh
✅ Files skipped from review due to trivial changes (4)
- docs/development.md
- tools/deploy/eda-scheduler/kustomization.yaml
- tools/deploy/environment.properties.example
- tools/deploy/eda-ui/kustomization.yaml
5926e47 to
550fa7a
Compare
|
/run-atf-tests |
|
| Metric | Count |
|---|---|
| Total Tests | 0 |
| ✅ Passed | 0 |
| ❌ Failed | 0 |
| 0 | |
| ⏭️ Skipped | 0 |
| ⏱️ Duration | 0.99s |
Update k8s-based deployments to use kind entirely instead of minikube. Remove standalone eda-kube.sh script which adds an unncessary maintenance burden. Assisted-by: Claude
550fa7a to
327a10e
Compare
|



Update k8s-based deployments to use kind entirely instead of minikube. Remove standalone eda-kube.sh script which adds an unnecessary maintenance burden.
https://redhat.atlassian.net/browse/AAP-77082
Changes
scripts/eda_kube.shand inline all logic into TaskfileCONTAINER_ENGINE)quay.io/ansible/eda-ui:mainimage instead of building UI locallylocalhost/image prefix to match podman's tagging schemeEDA_RESOURCE_SERVER__andEDA_ANSIBLE_BASE_JWT_KEYenv vars to API deployment for session authwait-for-postgresinit container withpg_isreadycheckwait-for-postgresinit containers to scheduler and worker deploymentscommonLabelswithlabels/includeSelectorsin all kustomization filesTest plan
Create a kind cluster:
Build and deploy:
Verify all pods start with 0 restarts (init containers should hold API, workers, and scheduler until postgres is ready):
Forward the UI port:
Access the UI at https://localhost:8443/ and login
Verify clean teardown:
(Optional) Test with Docker instead of podman:
Assisted-by: Claude
Summary by CodeRabbit
New Features
Improvements
Documentation
Chores