Skip to content

Commit 0794de0

Browse files
committed
ROX-28509: Extract ACS-CS tenant resources Helm chart
0 parents  commit 0794de0

31 files changed

Lines changed: 2787 additions & 0 deletions

‎.github/workflows/ci.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types: [opened, synchronize, reopened, ready_for_review]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
pre-commit:
16+
name: Run pre-commit hooks
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
23+
- uses: pre-commit/action@v3.0.1
24+
helm:
25+
name: Lint and test Helm chart
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: azure/setup-helm@v4.3.0
30+
with:
31+
version: v3.17.3
32+
- name: Install helm-unittest
33+
run: |
34+
helm plugin install \
35+
https://github.com/helm-unittest/helm-unittest.git \
36+
--version v1.0.3
37+
- run: helm lint .
38+
- run: helm unittest .

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
.idea/
3+
.vscode/
4+
*.tgz

‎.helmignore‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

‎.pre-commit-config.yaml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/adrienverge/yamllint
9+
rev: v1.37.1
10+
hooks:
11+
- id: yamllint
12+
- repo: https://github.com/Yelp/detect-secrets
13+
rev: v1.5.0
14+
hooks:
15+
- id: detect-secrets
16+
args: ["--baseline", ".secrets.baseline"]
17+
- repo: https://github.com/rhysd/actionlint
18+
rev: v1.7.7
19+
hooks:
20+
- id: actionlint

‎.secrets.baseline‎

Lines changed: 133 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.yamllint.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
extends: default
3+
ignore: |
4+
templates/*.yaml
5+
rules:
6+
line-length:
7+
max: 120

‎AGENTS.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Agent guidance
2+
3+
## Purpose and structure
4+
5+
This public repository contains the ACS-CS per-tenant `tenant-resources` Helm
6+
chart. `Chart.yaml` and `values.yaml` are at the root; templates are in
7+
`templates/`, supporting CIDR templates in `config/`, and helm-unittest suites in
8+
`tests/`.
9+
10+
Fleetshard-sync (in `stackrox/acs-fleet-manager`) reconciles tenant ArgoCD
11+
Applications using this chart.
12+
13+
## Commands
14+
15+
```bash
16+
helm lint .
17+
helm unittest .
18+
pre-commit run --all-files
19+
```
20+
21+
Use Helm 3 and helm-unittest v1.0.3, matching CI. See `README.md` for setup.
22+
Add regression tests for template or value behavior changes.
23+
24+
## Working rules
25+
26+
- Preserve chart name `tenant-resources`, helper names, labels, and the values
27+
interface unless an intentional migration includes fleetshard-sync changes.
28+
- Edit chart sources, not generated tenant manifests.
29+
- Never commit tenant identifiers from real environments, credentials, tokens,
30+
private certificates, rendered production values, or private runbooks.
31+
- Secret values are injected at runtime; keep fixtures synthetic.
32+
- Do not run live `kubectl`/`oc` modifications or release workflows as validation.
33+
- Environment revisions are managed by the manifests repository's stage/prod
34+
revision-update workflows. Production must not follow an unpinned `HEAD`.
35+
- Explicit per-tenant source overrides can bypass those defaults. Account for
36+
both repository URL and root chart path (`.`) when changing source settings.

‎Chart.yaml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: tenant-resources
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.0.1
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.0.0"

‎README.md‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ACS-CS tenant resources
2+
3+
Helm chart for the per-tenant RHACS resources managed by ACS Cloud Service.
4+
The chart renders a `Central` custom resource and supporting network policies,
5+
routes, declarative configuration, secret-store integration, and optional
6+
monitoring, priority classes, disruption budgets, and autoscaling resources.
7+
8+
## How it is deployed
9+
10+
Fleetshard-sync reconciles a tenant ArgoCD Application pointing at this repository.
11+
ArgoCD renders and synchronizes the chart.
12+
13+
The fleetshard-sync chart in
14+
[`stackrox/acs-fleet-manager`](https://github.com/stackrox/acs-fleet-manager)
15+
accepts:
16+
17+
```yaml
18+
gitops:
19+
tenantDefaultAppSourceRepoUrl: https://github.com/stackrox/acscs-tenant-resources
20+
tenantDefaultAppSourceTargetRevision: HEAD
21+
tenantDefaultAppSourcePath: .
22+
```
23+
24+
## Configuration
25+
26+
[`values.yaml`](values.yaml) is the configuration reference. Fleetshard-sync
27+
provides tenant identity, environment, database connection references, routes,
28+
and resource settings at reconciliation time. Important groups include:
29+
30+
- Tenant identity: `organizationId`, `instanceId`, `instanceName`, `instanceType`.
31+
- Placement and rollout: `clusterName`, `environment`, `rolloutGroup`, affinities,
32+
node selectors, and tolerations.
33+
- Workloads: `centralResources`, `scannerResources`, `scannerV4Enabled`, and
34+
the corresponding database and Scanner V4 resource settings.
35+
- Networking: `centralUIHost`, `centralDataHost`, route restrictions, and network
36+
policy CIDR templates in `config/`.
37+
- Configuration and integrations: `declarativeConfig`, secret-store resources,
38+
profiling, health checks, and VPA.
39+
40+
Never commit real tenant data, database credentials, tokens, certificates, or
41+
rendered production manifests. Supply secrets through the existing runtime
42+
secret-management integrations.
43+
44+
## Development
45+
46+
Install Helm 3 and [pre-commit](https://pre-commit.com/), then:
47+
48+
```bash
49+
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.3
50+
pre-commit install
51+
helm lint .
52+
helm unittest .
53+
pre-commit run --all-files
54+
```
55+
56+
Render locally with non-sensitive example values:
57+
58+
```bash
59+
helm template example . --namespace example-tenant \
60+
--set instanceId=example --set instanceName=example \
61+
--set organizationId=example --set clusterName=example \
62+
--set centralUIHost=central.example.com \
63+
--set centralDataHost=central-data.example.com
64+
```
65+
66+
Tests in `tests/` use helm-unittest. Add focused regression tests when changing
67+
templates or value semantics. Keep the chart name and existing value interface
68+
compatible with fleetshard-sync.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- fc00::/7 # RFC 4193 local private network range
2+
- fe80::/10 # RFC 4291 link-local (directly plugged) machines

0 commit comments

Comments
 (0)