Skip to content

Commit 275c8ba

Browse files
committed
fixed RBAC hooks, sed replaces, and Notes
1 parent bba8d1e commit 275c8ba

7 files changed

Lines changed: 52 additions & 293 deletions

File tree

charts/orchestrator-software-templates-infra/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ oc wait --for=condition=Ready pod --all -n openshift-pipelines --timeout=120s
4646
Run the following command to validate that the openshift-gitops namespace and all pods within it are operational:
4747

4848
oc wait --for=jsonpath='{.status.phase}'=Active namespace/openshift-gitops --timeout=80s && \
49-
oc wait --for=condition=Ready pod --all -n {{ .Release.Namespace }} --timeout=120s
49+
oc wait --for=condition=Ready pod --all -n orchestrator-gitops --timeout=120s
5050
{{- end }}

charts/orchestrator-software-templates/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ annotations:
55
apiVersion: v2
66
name: orchestrator-software-templates
77
description: >
8-
A Helm chart to install Openshift GitOps and Openshift Pipelines, which are required operators for installing Software Templates to be avaliable on RHDH.
8+
This Helm chart deploys the Orchestrator Software Templates for Red Hat Developer Hub (RHDH) and other necessary GitOps configurations.
9+
910
kubeVersion: ">= 1.25.0-0"
1011
type: application
1112
sources:

charts/orchestrator-software-templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square)
55
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
66

7-
A Helm chart to install Openshift GitOps and Openshift Pipelines, which are required operators for installing Software Templates to be avaliable on RHDH.
7+
This Helm chart deploys the Orchestrator Software Templates for Red Hat Developer Hub (RHDH) and other necessary GitOps configurations.
88

99
## Maintainers
1010

charts/orchestrator-software-templates/templates/NOTES.txt

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,5 @@
11
{{/* Empty line */}}
22
Helm Release {{ .Release.Name }} installed in namespace {{ .Release.Namespace }}.
3-
{{- $yes := "YES" }}
4-
{{- $no := "NO " }}
5-
{{- $tektonPipelineInstalled := $no }}
6-
{{- $tektonTaskInstalled := $no }}
7-
{{- $argocdInstalled := $no }}
8-
{{- $orchestratorAuthInstalled := $no }}
9-
{{- $orchestratorCatalogInstalled := $no }}
10-
11-
{{- if eq "true" (include "install-tekton-pipeline" .) }}
12-
{{- $tektonPipelineInstalled = $yes }}
13-
{{- end }}
14-
15-
{{- if eq "true" (include "install-tekton-task" .) }}
16-
{{- $tektonTaskInstalled = $yes }}
17-
{{- end }}
18-
19-
{{- if eq "true" (include "install-argocd-project" .) }}
20-
{{- $argocdInstalled = $yes }}
21-
{{- end }}
22-
23-
{{- if .Values.rhdhConfig.enabled }}
24-
{{- $orchestratorAuthInstalled = $yes }}
25-
{{- $orchestratorCatalogInstalled = $yes }}
26-
{{- end }}
27-
28-
{{- $gitopsNamespace := include "get-argocd-namespace" . }}
29-
30-
Components Installed Namespace
31-
====================================================================
32-
Tekton pipeline {{ $tektonPipelineInstalled }} {{ $gitopsNamespace }}
33-
Tekton task {{ $tektonTaskInstalled }} {{ $gitopsNamespace }}
34-
ArgoCD project {{ $argocdInstalled }} {{ $gitopsNamespace }}
35-
Orchestrator auth config {{ $orchestratorAuthInstalled }} {{ .Release.Namespace }}
36-
Orchestrator catalog config {{ $orchestratorCatalogInstalled }} {{ .Release.Namespace }}
37-
====================================================================
383

394
Prerequisites check:
405
{{- if not (.Capabilities.APIVersions.Has "tekton.dev/v1/Task") }}
@@ -78,8 +43,8 @@ Next Steps:
7843
RHDH_ROUTE="https://$(oc get route -n {{ .Values.orchestratorTemplates.rhdhChartNamespace }} -o jsonpath='{.items[0].spec.host}')"
7944

8045
# Copy template and replace placeholders
81-
cp orchestrator-templates-values.yaml.template orchestrator-templates-values.yaml
82-
sed -i "s|{RHDH_BASE_URL}|$RHDH_ROUTE|g" orchestrator-templates-values.yaml
46+
cp ../hack/orchestrator-templates-values.yaml.template orchestrator-templates-values.yaml
47+
sed -i "s|__RHDH_BASE_URL__|$RHDH_ROUTE|g" orchestrator-templates-values.yaml
8348

8449
2. Backup current values and upgrade backstage chart:
8550

@@ -93,33 +58,11 @@ Next Steps:
9358
-f current-backstage-values.yaml \
9459
-f orchestrator-templates-values.yaml
9560

96-
3. Verify the deployment:
97-
98-
{{- if .Values.rhdhConfig.enabled }}
99-
kubectl get configmaps -n {{ .Release.Namespace }} -l rhdh.redhat.com/ext-config-sync=true
100-
{{- end }}
101-
kubectl get pipelines,tasks -n {{ $gitopsNamespace }}
102-
kubectl get appprojects -n {{ $gitopsNamespace }}
61+
3. Wait for the backstage deployment to finish rollout
10362

10463
4. Access your RHDH instance and check the 'Create' section for new software templates.
10564

10665

107-
====================================================================
108-
Troubleshooting:
109-
====================================================================
110-
111-
If upgrade fails, rollback:
112-
helm rollback {{ .Values.orchestratorTemplates.rhdhChartReleaseName }} -n {{ .Values.orchestratorTemplates.rhdhChartNamespace }}
113-
114-
If placeholders remain in values file:
115-
grep "{.*}" my-orchestrator-values.yaml
116-
117-
If software templates not visible:
118-
kubectl logs -n {{ .Values.orchestratorTemplates.rhdhChartNamespace }} -l app.kubernetes.io/name=backstage
119-
120-
If ConfigMaps not loading:
121-
kubectl get configmaps -n {{ .Release.Namespace }} -l rhdh.redhat.com/ext-config-sync=true
122-
12366
For more information, visit:
12467
https://github.com/redhat-developer/rhdh-chart
12568

charts/orchestrator-software-templates/templates/rbac.yaml

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,62 @@ kind: ServiceAccount
33
metadata:
44
name: backstage
55
namespace: {{ .Values.orchestratorTemplates.rhdhChartNamespace }}
6-
---
7-
apiVersion: rbac.authorization.k8s.io/v1
8-
kind: RoleBinding
9-
metadata:
10-
namespace: {{ .Values.orchestratorTemplates.argocd.argocdNamespace }}
11-
name: backstage-k8s-read-binding
12-
roleRef:
13-
apiGroup: rbac.authorization.k8s.io
14-
kind: Role
15-
name: backstage-k8s-read
16-
subjects:
17-
- kind: ServiceAccount
18-
name: backstage
19-
namespace: {{ .Values.orchestratorTemplates.rhdhChartNamespace }}
6+
annotations:
7+
"helm.sh/hook": pre-install,pre-upgrade
8+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
9+
"helm.sh/hook-weight": "-5"
2010
---
2111
apiVersion: rbac.authorization.k8s.io/v1
2212
kind: Role
2313
metadata:
24-
namespace: {{ .Values.orchestratorTemplates.argocd.argocdNamespace }}
14+
namespace: {{ .Values.argocd.argocdNamespace }}
2515
name: backstage-k8s-read
16+
annotations:
17+
"helm.sh/hook": pre-install,pre-upgrade
18+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
19+
"helm.sh/hook-weight": "-4"
2620
rules:
27-
- apiGroups: ["", "apps", "batch", "networking.k8s.io", "tekton.dev", "route.openshift.io", "autoscaling"]
28-
resources: ["pods", "services", "configmaps", "limitranges", "resourcequotas", "deployments", "replicasets", "statefulsets", "jobs", "cronjobs", "ingresses", "horizontalpodautoscalers", "pipelines", "pipelineruns", "taskruns", "routes", "daemonsets"]
21+
- apiGroups:
22+
[
23+
"",
24+
"apps",
25+
"batch",
26+
"networking.k8s.io",
27+
"tekton.dev",
28+
"route.openshift.io",
29+
"autoscaling",
30+
]
31+
resources:
32+
[
33+
"pods",
34+
"services",
35+
"configmaps",
36+
"limitranges",
37+
"resourcequotas",
38+
"deployments",
39+
"replicasets",
40+
"statefulsets",
41+
"jobs",
42+
"cronjobs",
43+
"ingresses",
44+
"horizontalpodautoscalers",
45+
"pipelines",
46+
"pipelineruns",
47+
"taskruns",
48+
"routes",
49+
"daemonsets",
50+
]
2951
verbs: ["get", "list", "watch"]
3052
---
3153
apiVersion: rbac.authorization.k8s.io/v1
3254
kind: RoleBinding
3355
metadata:
34-
namespace: {{ .Values.orchestratorTemplates.argocd.argocdNamespace }}
56+
namespace: {{ .Values.argocd.argocdNamespace }}
3557
name: backstage-k8s-read-binding
58+
annotations:
59+
"helm.sh/hook": pre-install,pre-upgrade
60+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
61+
"helm.sh/hook-weight": "-3"
3662
roleRef:
3763
apiGroup: rbac.authorization.k8s.io
3864
kind: Role

hack/orchestrator-templates-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function captureGitClientSecret {
150150
}
151151

152152
function captureArgoCDNamespace {
153-
default="openshift-gitops"
153+
default="orchestrator-gitops"
154154
if [ "$use_default" == true ]; then
155155
argocd_namespace="$default"
156156
else

0 commit comments

Comments
 (0)