aws-samples / aws-samples/appmod-blueprints

refactor(kro): convert resource-groups manifests to a Helm chart for value injection

Open
#716 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
105
Forks
62
Avg merge
11h 17m
Merged PRs (30d)
76

Description

## Problem

The KRO ResourceGraphDefinitions in `gitops/addons/charts/kro/resource-groups/manifests/` are deployed by ArgoCD in **directory mode** (`type: manifest` + `directory.recurse: true`), not as a Helm chart.

Registry entries (`kro-manifests`, `kro-manifests-hub`):
```yaml
kro-manifests-hub:
type: manifest
path: ...addons/charts/kro/resource-groups/manifests
directory:
recurse: true
```

Because there is no Helm templating, the RGDs rely on **hardcoded KRO schema defaults** and cannot receive cluster-specific values from the cluster secret annotations.

## Symptoms

- `deployClusterName: string | default="peeks-spoke-dev"` — wrong default; spoke cluster names are `spoke-dev`/`spoke-prod` on this branch
- `resourcePrefix: string | default="peeks"` — hardcoded
- `peeks-cluster-mgmt-*` role names hardcoded in IAMRoleSelectors
- ECR repo paths hardcode `peeks/` prefix

Workaround currently applied: inject the missing values via the Backstage `system-info` entity (e.g. `spoke_dev_cluster_name`, `spoke_prod_cluster_name`) and map them in the templates/skeletons. This works for Backstage-driven flows but does not fix the RGD defaults themselves.

## Proposed Solution

Convert `addons/charts/kro/resource-groups/` into a proper Helm chart:

1. Add `Chart.yaml` + `values.yaml`
2. Template the RGD schema defaults and IAMRoleSelector ARNs from values:
- `clusterName`, `resourcePrefix`, `accountId`, `region`
- spoke cluster names (`deployClusterName`)
- `{prefix}-cluster-mgmt-*` role names
3. Change the registry entries from `type: manifest`/`directory` to Helm with `valuesObject` sourced from cluster secret annotations (same pattern as other addons):
```yaml
valuesObject:
global:
clusterName: "{{.metadata.annotations.aws_cluster_name}}"
resourcePrefix: "{{.metadata.annotations.resource_prefix}}"
accountId: "{{.metadata.annotations.aws_account_id}}"
region: "{{.metadata.annotations.aws_region}}"
```

## Impact

- Removes hardcoded `peeks*` defaults
- Per-environment / per-cluster RGD customization
- Consistent with the rest of the addon registry (Helm-based)
- Enables proper multi-account / multi-cluster naming

## Scope

Affects: `deployClusterName`, `resourcePrefix`, mgmt role names, ECR prefixes across appmodservice, cicd-pipeline, ray-service, eks RGDs.

## References

- PR #709
- Related: #714 (AppmodService resources field)

Contributor guide

Open the contributing guide

Research direction

Start with addons/charts/kro/resource-groups/manifests/ and the registry entries for kro-manifests and kro-manifests-hub; compare them with other Helm-based addons. Trace the appmodservice, cicd-pipeline, ray-service, and eks RGDs to identify every hardcoded default and selector. Done means the directory is a Helm chart, registry values come from cluster annotations, and the affected names and prefixes are configurable per cluster.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes, yaml
Domain
devops, infrastructure
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.