Skip to content
Draft
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
12 changes: 0 additions & 12 deletions container/helm/charts/openqa/Chart.lock

This file was deleted.

Empty file.
12 changes: 0 additions & 12 deletions container/helm/charts/openqa/values.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions container/helm/charts/webui/Chart.lock

This file was deleted.

10 changes: 0 additions & 10 deletions container/helm/charts/webui/Chart.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions container/helm/openqa/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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
.gitkeep
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# Helm files
Chart.lock
*.tgz
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
apiVersion: v2
name: openqa
description: A Helm chart for openQA in Kubernetes
type: application
version: 0.1.0
home: https://open.qa
icon: https://raw.githubusercontent.com/os-autoinst/openQA/master/assets/images/logo.svg
dependencies:
- name: webui
repository: file://../webui/
version: ~0.1.0
condition: webui.enabled
- name: postgresql
version: 15.5.38
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: worker
repository: file://../worker/
repository: file://charts/worker/
version: ~0.1.0
condition: worker.enabled
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Common VCS dirs
.git/
.gitignore
.gitkeep
.bzr/
.bzrignore
.hg/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
data:
workers_ini: |
[global]
HOST = {{ .Values.openqa.host }}
HOST = http://{{ .Release.Name }}-openqa:9526
WORKER_HOSTNAME = {{ .Release.Name }}-worker
BACKEND = qemu
{{ if .Values.workerClass -}}
WORKER_CLASS = {{ .Values.workerClass }}
Expand All @@ -21,6 +22,10 @@ data:
TESTPOOLSERVER = rsync://{{ .Values.openqa.host }}/tests
{{ end }}
client_conf: |
[{{ .Values.openqa.host }}]
[localhost]
key = {{ .Values.openqa.key }}
secret = {{ .Values.openqa.secret }}

[{{ .Release.Name }}-openqa]
key = {{ .Values.openqa.key }}
secret = {{ .Values.openqa.secret }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
labels:
{{- include "worker.selectorLabels" . | nindent 8 }}
spec:
initContainers:
- name: wait-for-webui
image: busybox:latest
command: ['sh', '-c', 'until nc -vz {{ .Release.Name }}-openqa 9526; do echo "Waiting for webui service"; sleep 2; done;']
# Future enhancement option: initContainer for git-pulling tests into /data
containers:
{{ if .Values.cacheService -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ image:
pullPolicy: Always
tag: "latest"
openqa:
host: openqa.host
key: 1234567890ABCDEF
secret: 1234567890ABCDEF
cacheService: false
Expand Down
21 changes: 21 additions & 0 deletions container/helm/openqa/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openqa.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openqa.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openqa.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openqa.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "webui.name" -}}
{{- define "openqa.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 the release name contains a chart name it will be used as a full name.
If release name contains chart name it will be used as a full name.
*/}}
{{- define "webui.fullname" -}}
{{- define "openqa.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If the release name contains a chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "webui.chart" -}}
{{- define "openqa.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "webui.labels" -}}
helm.sh/chart: {{ include "webui.chart" . }}
{{ include "webui.selectorLabels" . }}
{{- define "openqa.labels" -}}
helm.sh/chart: {{ include "openqa.chart" . }}
{{ include "openqa.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,7 +45,18 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "webui.selectorLabels" -}}
app.kubernetes.io/name: {{ include "webui.name" . }}
{{- define "openqa.selectorLabels" -}}
app.kubernetes.io/name: {{ include "openqa.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "openqa.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openqa.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "webui.fullname" . }}-configmap
name: {{ include "openqa.fullname" . }}-configmap
labels:
{{- include "webui.labels" . | nindent 4 }}
{{- include "openqa.labels" . | nindent 4 }}
data:
client_conf: |
[localhost]
Expand All @@ -17,20 +17,26 @@ data:
[{{ .Chart.Name }}-websockets]
key = {{ .Values.key }}
secret = {{ .Values.secret }}

[{{ .Release.Name }}-openqa:9526]
key = {{ .Values.key }}
secret = {{ .Values.secret }}

database_ini: |
[production]
dsn = DBI:Pg:dbname={{ .Values.postgresql.auth.database }};host=db;user={{ .Values.postgresql.auth.username }};password={{ .Values.postgresql.auth.password }}

[development]
dsn = DBI:Pg:dbname={{ .Values.postgresql.auth.database }};host=db;user={{ .Values.postgresql.auth.username }};password={{ .Values.postgresql.auth.password }}

openqa_ini: |
[global]
# change to the URL the web UI will be available under so redirection for
# authentication works
base_url = {{ .Values.useHttps | ternary "https://" "http://" }}{{ .Values.baseUrl }}

[auth]
method = OpenID
method = Fake

[logging]
level = info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "webui.fullname" . }}
name: {{ include "openqa.fullname" . }}
labels:
{{- include "webui.labels" . | nindent 4 }}
{{- include "openqa.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "webui.selectorLabels" . | nindent 6 }}
{{- include "openqa.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "webui.selectorLabels" . | nindent 8 }}
{{- include "openqa.selectorLabels" . | nindent 8 }}
spec:
initContainers:
- name: wait-for-db
image: "postgres:latest"
command: ["sh", "-c", "until pg_isready -h db -p 5432; do echo waiting for database; sleep 2; done;"]
containers:
# Future enhancement option: a container with rsync for setup with cache service
- name: {{ include "webui.fullname" . }}-scheduler
- name: {{ include "openqa.fullname" . }}-scheduler
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
Expand All @@ -37,7 +41,7 @@ spec:
readinessProbe:
exec:
command: ["curl", "-f", "http://localhost:9529"]
- name: {{ include "webui.fullname" . }}-websockets
- name: {{ include "openqa.fullname" . }}-websockets
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
Expand All @@ -56,7 +60,11 @@ spec:
readinessProbe:
exec:
command: ["curl", "-f", "http://localhost:9527"]
- name: {{ include "webui.fullname" . }}-gru
# Give the app 15 seconds to start before probing
initialDelaySeconds: 15
# Give the probe 5 seconds to respond
timeoutSeconds: 5
- name: {{ include "openqa.fullname" . }}-gru
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
Expand All @@ -73,7 +81,7 @@ spec:
readinessProbe:
exec:
command: ["grep", "started", "/var/log/gru.log"]
- name: {{ include "webui.fullname" . }}-livehandler
- name: {{ include "openqa.fullname" . }}-livehandler
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
Expand All @@ -92,7 +100,7 @@ spec:
readinessProbe:
exec:
command: ["curl", "-f", "http://localhost:9528"]
- name: {{ include "webui.fullname" . }}-webui
- name: {{ include "openqa.fullname" . }}-webui
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
Expand All @@ -119,11 +127,12 @@ spec:
emptyDir: {}
- name: config
configMap:
name: {{ include "webui.fullname" . }}-configmap
name: {{ include "openqa.fullname" . }}-configmap
items:
- key: client_conf
path: client.conf
- key: openqa_ini
path: openqa.ini
- key: database_ini
path: database.ini

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "webui.fullname" . }}-ingress
name: {{ include "openqa.fullname" . }}-ingress
spec:
ingressClassName: traefik
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ .Values.baseUrl }}
http:
Expand All @@ -12,20 +13,21 @@ spec:
pathType: Prefix
backend:
service:
name: {{ include "webui.fullname" . }}
name: {{ include "openqa.fullname" . }}
port:
name: webui
- path: /api/v1/ws
pathType: Prefix
backend:
service:
name: {{ include "webui.fullname" . }}
name: {{ include "openqa.fullname" . }}
port:
name: websockets
- path: /livehandler
pathType: Prefix
backend:
service:
name: {{ include "webui.fullname" . }}
name: {{ include "openqa.fullname" . }}
port:
name: livehandler
{{- end }}
Loading
Loading