Skip to content

Commit b9f3fc6

Browse files
committed
feat(charts): add rhoso-apps helm chart and ci
Add Helm chart for Argo CD Applications (templates, values, values.schema.json), and a path-filtered GitHub Actions workflow (lint, template, package) with a TODO for publishing release artifacts. Refs: https://redhat.atlassian.net/browse/OSPRH-27658 AI-Assist: Cursor; model=Composer-2; mode=agent; origin=cursor Made-with: Cursor
1 parent 61cd3ac commit b9f3fc6

8 files changed

Lines changed: 384 additions & 0 deletions

File tree

.github/workflows/helm-chart.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# Validate charts/rhoso-apps: lint (incl. values.schema.json), template, package.
3+
# TODO: When release process is defined, persist and publish the chart artifact
4+
# (rhoso-apps-<version>.tgz from `helm package`)—e.g. GitHub Release asset, Helm
5+
# HTTP repo, or OCI registry—for downloadable installs.
6+
name: helm-chart
7+
permissions:
8+
contents: read
9+
on: # yamllint disable-line rule:truthy
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- "charts/**"
15+
- ".github/workflows/helm-chart.yml"
16+
push:
17+
branches:
18+
- main
19+
paths:
20+
- "charts/**"
21+
- ".github/workflows/helm-chart.yml"
22+
jobs:
23+
validate:
24+
runs-on: ubuntu-latest
25+
defaults:
26+
run:
27+
working-directory: charts/rhoso-apps
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install Helm
33+
uses: azure/setup-helm@v4
34+
with:
35+
version: v3.16.3
36+
37+
- name: Helm lint
38+
run: helm lint . -f values.yaml
39+
40+
- name: Helm template
41+
run: helm template rhoso-apps-test . -f values.yaml >/dev/null
42+
43+
# Produces rhoso-apps-*.tgz; publishing is TODO until release workflow exists (see file header).
44+
- name: Helm package
45+
run: helm package .

.yamllint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ignore:
55
- '*.env'
66
- '*.txt'
77
- '*.sh'
8+
# Helm templates are not valid YAML until rendered (Go templating).
9+
- 'charts/**/templates/**'
810

911
rules:
1012
line-length:

charts/rhoso-apps/.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/

charts/rhoso-apps/Chart.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
apiVersion: v2
3+
name: rhoso-apps
4+
description: Create and manage argocd applications to deploy RHOSO
5+
6+
# A chart can be either an 'application' or a 'library' chart.
7+
#
8+
# Application charts are a collection of templates that can be packaged into versioned archives
9+
# to be deployed.
10+
#
11+
# Library charts provide useful utilities or functions for the chart developer. They're included as
12+
# a dependency of application charts to inject those utilities and functions into the rendering
13+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
14+
type: application
15+
16+
# This is the chart version. This version number should be incremented each time you make changes
17+
# to the chart and its templates, including the app version.
18+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19+
version: 0.1.0
20+
21+
# This is the version number of the application being deployed. This version number should be
22+
# incremented each time you make changes to the application. Versions are not expected to
23+
# follow Semantic Versioning. They should reflect the version the application is using.
24+
# It is recommended to use it with quotes.
25+
appVersion: "18.0.17"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{/*
2+
Namespace for Argo CD Application CRs (metadata.namespace).
3+
Pass root context ($) from inside range.
4+
*/}}
5+
{{- define "rhoso-apps.applicationNamespace" -}}
6+
{{- default "openshift-gitops" .Values.applicationNamespace | quote -}}
7+
{{- end }}
8+
9+
{{/*
10+
Default Kubernetes API server URL for spec.destination.server.
11+
Pass root context ($) from inside range.
12+
*/}}
13+
{{- define "rhoso-apps.destinationServer" -}}
14+
{{- default "https://kubernetes.default.svc" .Values.destinationServer | quote -}}
15+
{{- end }}
16+
17+
{{/*
18+
Argo CD AppProject name; empty string in values maps to "default".
19+
Pass dict with key "app" (per-application values map).
20+
*/}}
21+
{{- define "rhoso-apps.argocdProject" -}}
22+
{{- $app := .app -}}
23+
{{- default "default" $app.project | quote -}}
24+
{{- end }}
25+
26+
{{/*
27+
Repository path under spec.source.path.
28+
*/}}
29+
{{- define "rhoso-apps.sourcePath" -}}
30+
{{- $app := .app -}}
31+
{{- default "." $app.path | quote -}}
32+
{{- end }}
33+
34+
{{/*
35+
Git revision, branch, or tag for spec.source.targetRevision.
36+
*/}}
37+
{{- define "rhoso-apps.targetRevision" -}}
38+
{{- $app := .app -}}
39+
{{- default "HEAD" $app.targetRevision | quote -}}
40+
{{- end }}
41+
42+
{{/*
43+
Merge syncPolicy map with optional syncOptions; emit spec.syncPolicy block or nothing.
44+
Pass dict with key "app" (per-application values map).
45+
*/}}
46+
{{- define "rhoso-apps.syncPolicySpec" -}}
47+
{{- $app := .app -}}
48+
{{- $merged := $app.syncPolicy | default dict }}
49+
{{- if not (kindIs "map" $merged) }}
50+
{{- $merged = dict }}
51+
{{- end }}
52+
{{- if and $app.syncOptions (not (empty $app.syncOptions)) }}
53+
{{- $merged = merge $merged (dict "syncOptions" $app.syncOptions) }}
54+
{{- end }}
55+
{{- if not (empty $merged) }}
56+
syncPolicy:
57+
{{ toYaml $merged | indent 4 }}
58+
{{- end }}
59+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- range $name, $app := .Values.applications }}
2+
{{- if $app.enabled }}
3+
---
4+
apiVersion: argoproj.io/v1alpha1
5+
kind: Application
6+
metadata:
7+
name: {{ $name }}
8+
namespace: {{ include "rhoso-apps.applicationNamespace" $ }}
9+
annotations:
10+
argocd.argoproj.io/sync-wave: {{ $app.syncWave | quote }}
11+
spec:
12+
project: {{ include "rhoso-apps.argocdProject" (dict "app" $app) }}
13+
source:
14+
repoURL: {{ $app.repoURL | quote }}
15+
path: {{ include "rhoso-apps.sourcePath" (dict "app" $app) }}
16+
targetRevision: {{ include "rhoso-apps.targetRevision" (dict "app" $app) }}
17+
destination:
18+
server: {{ include "rhoso-apps.destinationServer" $ }}
19+
{{ include "rhoso-apps.syncPolicySpec" (dict "app" $app) }}
20+
{{- end }}
21+
{{- end }}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/openstack-k8s-operators/gitops/charts/rhoso-apps/values.schema.json",
4+
"title": "rhoso-apps Helm chart values",
5+
"description": "Validated against templates/ and the documentation block in values.yaml.",
6+
"type": "object",
7+
"required": [
8+
"applicationNamespace",
9+
"destinationServer",
10+
"applications"
11+
],
12+
"additionalProperties": false,
13+
"properties": {
14+
"applicationNamespace": {
15+
"type": "string",
16+
"minLength": 1,
17+
"description": "Namespace for Argo CD Application CRs (metadata.namespace).",
18+
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
19+
},
20+
"destinationServer": {
21+
"type": "string",
22+
"minLength": 1,
23+
"description": "Kubernetes API server URL for spec.destination.server.",
24+
"format": "uri",
25+
"pattern": "^https://"
26+
},
27+
"applications": {
28+
"type": "object",
29+
"minProperties": 1,
30+
"description": "Map of Application name to Argo CD Application settings.",
31+
"propertyNames": {
32+
"description": "DNS-1123 label: lowercase alphanumeric and hyphens (e.g. openstack-operator-cr).",
33+
"pattern": "^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$"
34+
},
35+
"additionalProperties": {
36+
"$ref": "#/definitions/application"
37+
}
38+
}
39+
},
40+
"definitions": {
41+
"application": {
42+
"type": "object",
43+
"description": "Per-application values under applications.<name>.",
44+
"required": [
45+
"enabled",
46+
"repoURL",
47+
"path",
48+
"targetRevision",
49+
"syncWave",
50+
"syncOptions"
51+
],
52+
"additionalProperties": false,
53+
"properties": {
54+
"enabled": {
55+
"type": "boolean",
56+
"description": "If true, render an Application CR."
57+
},
58+
"repoURL": {
59+
"type": "string",
60+
"minLength": 1,
61+
"description": "Git repository URL for spec.source.repoURL.",
62+
"format": "uri",
63+
"pattern": "^https://"
64+
},
65+
"path": {
66+
"type": "string",
67+
"description": "Path inside the repo; empty string uses chart default '.'."
68+
},
69+
"targetRevision": {
70+
"type": "string",
71+
"description": "Branch, tag, or commit; empty string uses chart default 'HEAD'."
72+
},
73+
"syncWave": {
74+
"type": "string",
75+
"description": "Value for argocd.argoproj.io/sync-wave annotation."
76+
},
77+
"syncOptions": {
78+
"type": "array",
79+
"description": "Argo CD sync option strings merged into spec.syncPolicy.syncOptions.",
80+
"minItems": 0,
81+
"items": {
82+
"type": "string",
83+
"minLength": 1
84+
}
85+
},
86+
"project": {
87+
"type": "string",
88+
"description": "Optional Argo CD AppProject; default in chart is 'default' if omitted."
89+
},
90+
"syncPolicy": {
91+
"type": "object",
92+
"description": "Optional map merged with syncOptions into spec.syncPolicy.",
93+
"additionalProperties": true
94+
}
95+
}
96+
}
97+
}
98+
}

charts/rhoso-apps/values.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
# Chart-wide defaults for every rendered Argo CD Application (see templates/).
3+
applicationNamespace: openshift-gitops
4+
destinationServer: https://kubernetes.default.svc
5+
applications:
6+
# ---------------------------------------------------------------------------
7+
# Example application — documentation only (everything below is commented out).
8+
# Copy the block, choose a unique key (DNS-1123 name), remove "# " prefixes,
9+
# set enabled: true, and fill repoURL / path / targetRevision as needed.
10+
#
11+
# Per-application keys (under applications.<name>):
12+
# enabled bool If true, render an Application CR; if false, skip.
13+
# repoURL string spec.source.repoURL (Git URL).
14+
# path string Directory in the repo; empty -> default ".".
15+
# targetRevision string Branch, tag, or commit; empty -> default "HEAD".
16+
# syncWave string argocd.argoproj.io/sync-wave annotation.
17+
# syncOptions list Optional strings merged into spec.syncPolicy.syncOptions
18+
# (e.g. Prune=true).
19+
# Optional overrides (supported by the chart; omitted from defaults below):
20+
# project string Argo CD AppProject; default "default" if unset.
21+
# syncPolicy map Merged with syncOptions into spec.syncPolicy.
22+
#
23+
# This chart does not set spec.destination.namespace; only destination.server
24+
# is set (from destinationServer above).
25+
#
26+
# example-my-app:
27+
# enabled: false
28+
# repoURL: https://github.com/openstack-k8s-operators/gitops
29+
# path: environments/example
30+
# targetRevision: main
31+
# syncWave: "0"
32+
# syncOptions:
33+
# - Prune=true
34+
# ---------------------------------------------------------------------------
35+
# Deploy and initialize MetalLB, nmstate, cert-manager.
36+
# This covers "Planning your deployment - chapter 3.1.3"
37+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/planning_your_deployment/assembly_infrastructure-and-system-requirements#ref_RHOCP-software-requirements_planning
38+
operator-dependencies:
39+
enabled: true
40+
path: "/examples/dependencies"
41+
repoURL: https://github.com/openstack-k8s-operators/gitops
42+
syncOptions:
43+
- Prune=true
44+
syncWave: "-20"
45+
targetRevision: v0.1.0
46+
# Deploy and configure vault-secrets operator.
47+
# This covers "Deploying RHOSO - chapter 2.3"
48+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_preparing-rhocp-for-rhoso#proc_providing-secure-access-to-the-RHOSO-services_preparing
49+
secrets:
50+
enabled: true
51+
path: "TODO"
52+
repoURL: https://github.com/openstack-k8s-operators/gitops
53+
syncOptions:
54+
- Prune=true
55+
syncWave: "-20"
56+
targetRevision: v0.1.0
57+
# Deploy openstack-operator.
58+
# This covers "Deploying RHOSO - chapter 1"
59+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_installing-and-preparing-the-openstack-operator
60+
openstack-operator:
61+
enabled: true
62+
path: "TODO"
63+
repoURL: https://github.com/openstack-k8s-operators/gitops
64+
syncOptions:
65+
- Prune=true
66+
syncWave: "-20"
67+
targetRevision: v0.1.0
68+
# Create the main OpenStack Custom Resource.
69+
# This covers "Deploying RHOSO - chapter 1"
70+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_installing-and-preparing-the-openstack-operator
71+
openstack-operator-cr:
72+
enabled: true
73+
path: "TODO"
74+
repoURL: https://github.com/openstack-k8s-operators/gitops
75+
syncOptions:
76+
- Prune=true
77+
syncWave: "-10"
78+
targetRevision: v0.1.0
79+
# Create underlying networks for controlplane and dataplane.
80+
# Covers "Deploying RHOSO - chapter 3"
81+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_preparing-rhoso-networks_preparing
82+
openstack-networks:
83+
enabled: true
84+
path: "TODO"
85+
repoURL: https://github.com/openstack-k8s-operators/gitops
86+
syncOptions:
87+
- Prune=true
88+
syncWave: "0"
89+
targetRevision: v0.1.0
90+
# Deploy and configure OpenStackControlPlane resource.
91+
# Covers "Deploying RHOSO - chapter 4"
92+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_creating-the-control-plane
93+
openstack-controlplane:
94+
enabled: true
95+
path: "examples/controlplane"
96+
repoURL: https://github.com/openstack-k8s-operators/gitops
97+
syncOptions:
98+
- Prune=true
99+
syncWave: "10"
100+
targetRevision: v0.1.0
101+
# Deploy and configure OpenStackDataPlaneNodeSet and OpenStackDataPlaneDeployment resources.
102+
# Covers "Deploying RHOSO - chapter 5"
103+
# https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/deploying_red_hat_openstack_services_on_openshift/assembly_creating-the-data-plane
104+
openstack-dataplane:
105+
enabled: true
106+
path: "examples/dataplane"
107+
repoURL: https://github.com/openstack-k8s-operators/gitops
108+
syncOptions:
109+
- Prune=true
110+
syncWave: "20"
111+
targetRevision: v0.1.0

0 commit comments

Comments
 (0)