Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions argocd/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions argocd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: cpt-dashboard
description: Set up ArgoCD for the dashboard

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.0"
26 changes: 26 additions & 0 deletions argocd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ArgoCD

This helm chart deploys ArgoCD "Application" manifests into a cluster's argocd
namespace for the "dashboard" and "dashboard-dev" applications.

Both applications refer to the "deploy" chart to define the deployment.

To "prime" a cluster for the CPT Dashboard, you need to have ArgoCD (upstream)
or OpenShift GitOps (downstream) installed along with the [Argo CD Image
Updater](https://argocd-image-updater.readthedocs.io/en/stable/).

1. If you're using the upstream ArgoCD, you'll need to edit the `values.yaml`
file to set the `argocd.namespace` to `argocd` instead of `openshift-gitops`.
2. Set the `cluster` variable in `values.yaml` to the base URL path where the
dashboard should be exposed. The final URLs will be `dashboard.<cluster>` and
`dashboard-dev.<cluster>`.
3. Create the `dashboard` and `dashboard-dev` namespaces using the
`oc new-project <name>` command. Using `new-project` rather than
`create namespace` ensures that the proper OpenShift attributes are applied to
allow ArgoCD to manage resources within the namespace.
4. Use the `helm install dashboard ./argocd` command to install a Helm
`dashboard` "release" containing two ArgoCD Application resources, for the
production dashboard and the development dashboard. Note that, in the `values.yaml`,
either deployment can be disabled by setting the `enabled` value to `false`.
You can override values referenced in the chart using `--set <key>=<value>`;
for example `--set cluster=apps.mydomain.com`.
Empty file added argocd/templates/NOTES.txt
Empty file.
62 changes: 62 additions & 0 deletions argocd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "helm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "helm.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "helm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "helm.labels" -}}
helm.sh/chart: {{ include "helm.chart" . }}
{{ include "helm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "helm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "helm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "helm.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "helm.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
39 changes: 39 additions & 0 deletions argocd/templates/dashboard-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{ if .Values.dashboard_dev.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .Values.dashboard_dev.name }}
namespace: {{ .Values.argocd.namespace }}
spec:
destination:
namespace: {{ .Values.dashboard_dev.namespace }}
server: https://kubernetes.default.svc
source:
path: deploy
repoURL: https://github.com/cloud-bulldozer/cpt-dashboard.git
targetRevision: HEAD
helm:
releaseName: {{ .Values.dashboard_dev.name }}
parameters:
- name: "fullnameOverride"
value: {{ .Values.dashboard_dev.name }}
- name: "ingress.hostName"
value: {{ .Values.dashboard_dev.name }}
- name: "ingress.baseDomain"
value: {{ .Values.cluster }}
- name: "frontend.image.tag"
value: {{ .Values.dashboard_dev.tag }}
- name: "backend.image.tag"
value: {{ .Values.dashboard_dev.tag }}
sources: []
project: default
syncPolicy:
managedNamespaceMetadata:
labels:
argocd.argoproj.io/managed-by: openshift-gitops
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
{{ end }}
40 changes: 40 additions & 0 deletions argocd/templates/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ if .Values.dashboard.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .Values.dashboard.name }}
namespace: {{ .Values.argocd.namespace }}
spec:
destination:
namespace: {{ .Values.dashboard.namespace }}
server: https://kubernetes.default.svc
source:
path: deploy
repoURL: https://github.com/cloud-bulldozer/cpt-dashboard.git
targetRevision: HEAD
helm:
releaseName: {{ .Values.dashboard.name }}
parameters:
- name: "fullnameOverride"
value: {{ .Values.dashboard.name }}
- name: "ingress.hostName"
value: {{ .Values.dashboard.name }}
- name: "ingress.baseDomain"
value: {{ .Values.cluster }}
- name: "frontend.image.tag"
value: {{ .Values.dashboard.tag }}
- name: "backend.image.tag"
value: {{ .Values.dashboard.tag }}
sources: []
project: default
syncPolicy:
managedNamespaceMetadata:
labels:
argocd.argoproj.io/managed-by: openshift-gitops
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- Replace=true
{{ end }}
13 changes: 13 additions & 0 deletions argocd/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
argocd:
namespace: openshift-gitops
cluster: "apps.ocp4.intlab.redhat.com"
dashboard:
enabled: true
name: dashboard
namespace: dashboard
tag: prod
dashboard_dev:
enabled: true
name: dashboard-dev
namespace: dashboard-dev
tag: latest
2 changes: 1 addition & 1 deletion backend/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1
0.2.1
6 changes: 3 additions & 3 deletions backend/backend.containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM quay.io/centos/centos:stream9

# 0) Configure Poetry and environment for OpenShift non-root execution
ENV POETRY_VIRTUALENVS_CREATE=false \
HOME=/opt/backend \
XDG_CONFIG_HOME=/opt/backend/.config \
XDG_CACHE_HOME=/opt/backend/.cache
HOME=/backend \
XDG_CONFIG_HOME=/backend/.config \
XDG_CACHE_HOME=/backend/.cache

# 1) Install system deps + Poetry globally (root)
# Installing Poetry globally ensures the binary is on /usr/local/bin
Expand Down
4 changes: 2 additions & 2 deletions deploy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: perfscale-dashboard
description: Performance and Scale Team Dashboard
type: application
version: 0.0.1
appVersion: 0.0.1
version: 0.2.1
appVersion: 0.2.1
4 changes: 1 addition & 3 deletions deploy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,5 @@ spec:
{{- toYaml .Values.backend.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /opt/backend/ocpperf.toml
mountPath: /backend/ocpperf.toml
subPath: ocpperf.toml


4 changes: 2 additions & 2 deletions deploy/templates/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{- include "dashboard.labels" . | nindent 4 }}
spec:
host: {{ .Values.ingress.hostName }}.{{ .Values.ingress.baseDomain }}
host: {{ include "dashboard.fullname" . }}.{{ .Values.ingress.baseDomain }}
port:
targetPort: 3000
to:
Expand All @@ -27,7 +27,7 @@ metadata:
labels:
{{- include "dashboard.labels" . | nindent 4 }}
spec:
host: {{ .Values.ingress.hostName }}.{{ .Values.ingress.baseDomain }}
host: {{ include "dashboard.fullname" . }}.{{ .Values.ingress.baseDomain }}
path: "/api"
port:
targetPort: 8000
Expand Down
1 change: 1 addition & 0 deletions deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ frontend:
repository: quay.io/cloud-bulldozer/frontend
tag: latest
resources: {}
securityContext: {}

backend:
image:
Expand Down
2 changes: 1 addition & 1 deletion testing/pod_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ podman run ${POD} --name="${POD_NAME}-init" -v "${CPT_CONFIG}:/backend/ocpperf.t
if [[ "${DEVEL}" -ne 1 || "${FRONTDEVEL}" -eq 1 ]]
then
echo "Starting backend container"
podman run -d ${POD} --name="${POD_NAME}-back" -v "${CPT_CONFIG}:/opt/backend/ocpperf.toml:Z" localhost/backend
podman run -d ${POD} --name="${POD_NAME}-back" -v "${CPT_CONFIG}:/backend/ocpperf.toml:Z" localhost/backend
fi
if [[ "${DEVEL}" -ne 1 && "${FRONTDEVEL}" -ne 1 ]]
then
Expand Down
Loading