Skip to content

feat: implement high-priority platform engineering improvements#8

Merged
tukue merged 4 commits into
mainfrom
feature/backstage-catalog
May 29, 2026
Merged

feat: implement high-priority platform engineering improvements#8
tukue merged 4 commits into
mainfrom
feature/backstage-catalog

Conversation

@tukue
Copy link
Copy Markdown
Owner

@tukue tukue commented May 29, 2026

  • Fix make deploy to use GitOps (remove imperative helm template | kubectl apply)
  • Move legacy/ to archive/ and update all references
  • Add PodDisruptionBudget template with Helm unit tests
  • Add ResourceQuota and RBAC for stage and prod namespaces
  • Add CI guard rejecting 'latest' image tags and 'HEAD' revisions
  • Parametrize AWS account ID across all values files

- Fix make deploy to use GitOps (remove imperative helm template | kubectl apply)
- Move legacy/ to archive/ and update all references
- Add PodDisruptionBudget template with Helm unit tests
- Add ResourceQuota and RBAC for stage and prod namespaces
- Add CI guard rejecting 'latest' image tags and 'HEAD' revisions
- Parametrize AWS account ID across all values files
Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR implements important platform engineering improvements including GitOps adoption, PodDisruptionBudget support, ResourceQuota/RBAC for environments, and immutable tag enforcement. However, there are critical defects that will prevent deployments from working.

Critical Issues (Must Fix Before Merge)

  1. Missing Image Repository Configuration - The image.repository field was removed from all 6 environment-specific values files (dev/stage/prod for both simple-app and app-b), but not replaced. This will cause Helm template rendering to produce invalid image references like :1.0.0 instead of 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app:1.0.0, breaking all deployments.

  2. PodDisruptionBudget Validation Error - The new PDB template allows both minAvailable and maxUnavailable to be undefined, which violates Kubernetes API requirements. The API server will reject PDBs with neither field set.

Positive Changes

The PR successfully implements:

  • GitOps workflow by removing imperative kubectl commands from Makefile
  • CI validation for immutable tags and revisions
  • ResourceQuota and RBAC configurations for stage and prod namespaces
  • PodDisruptionBudget template with Helm unit tests
  • Legacy code archival

Action Required: Address the critical image repository and PDB validation issues before merging to prevent production deployment failures.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.


⚠️ This PR contains more than 30 files. Amazon Q is better at reviewing smaller PRs, and may miss issues in larger changesets.

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-dev.1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Removing image.repository without replacement will cause Helm template rendering to fail. The deployment template (line 45) expects .Values.image.repository to construct the full image reference. With this field removed and the base values.yaml using an empty string, the rendered image will be invalid (e.g., :1.0.0-dev.1 instead of <account>.dkr.ecr.<region>.amazonaws.com/app:1.0.0-dev.1).

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-dev.1"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-dev.1"

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-rc1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Missing image.repository field will cause deployment failures. Add the repository configuration to ensure proper image reference.

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-rc1"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0-rc1"

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Missing image.repository field will cause deployment failures. Add the repository configuration to ensure proper image reference.

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "1.0.0"

Comment on lines +8 to +15
spec:
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: PodDisruptionBudget allows both minAvailable and maxUnavailable to be undefined simultaneously. According to Kubernetes API validation, at least one of these fields must be specified. When both are empty, the PDB will be rejected by the API server with an error.

Suggested change
spec:
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- else if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- else }}
{{- fail "podDisruptionBudget.minAvailable or podDisruptionBudget.maxUnavailable must be set when podDisruptionBudget.enabled is true" }}
{{- end }}
selector:

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-dev.1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Missing image.repository field will cause deployment failures. Add the repository configuration to ensure proper image reference.

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-dev.1"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-dev.1"

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-rc1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Missing image.repository field will cause deployment failures. Add the repository configuration to ensure proper image reference.

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-rc1"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0-rc1"

Comment on lines 3 to 4
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Deployment Failure Risk: Missing image.repository field will cause deployment failures. Add the repository configuration to ensure proper image reference.

Suggested change
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0"
image:
repository: 944684220857.dkr.ecr.eu-north-1.amazonaws.com/app
tag: "2.0.0"

tukue added 3 commits May 29, 2026 13:08
- Restore working ECR URL as chart default image.repository (configurable
  via Makefile AWS_ACCOUNT_ID and AWS_REGION variables)
- Add Helm fail guard to PDB template when both minAvailable and
  maxUnavailable are unset (required by Kubernetes API validation)
GitHub API rate limiting causes the dynamic version fetch to return
null, resulting in a 404 download. Pin to v1.18.0 as fallback.
- Rename all template include names (my-app.xxx -> app.xxx)
- Change test-connection image from busybox to alpine:3.19
- Remove hardcoded image.repository from chart default (now set via --set)
- Add --set image.repository to all helm template commands in Makefile and CI
@tukue tukue merged commit 34cdcc5 into main May 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant