Skip to content

Commit

Permalink
TestManager v2 (#33)
Browse files Browse the repository at this point in the history
* TestManager v2
  • Loading branch information
dblane-digicatapult authored Oct 11, 2023
1 parent f8f68bb commit 4501155
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 83 deletions.
6 changes: 3 additions & 3 deletions charts/testmanager/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.5.7
digest: sha256:1b88720b28cd097236ebb696fc76a6fccabe0fe46fa72050cfd56657b0d1c686
generated: "2023-06-13T11:48:37.838701+01:00"
version: 12.12.10
digest: sha256:940cb5e45876deacafa82af06c585ece1cd95764c9507ef32d64c535ada13018
generated: "2023-10-11T10:14:31.934331+01:00"
6 changes: 3 additions & 3 deletions charts/testmanager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v2
name: testmanager
appVersion: 0.1.1
appVersion: 0.0.11
description: A generated Helm Chart for Soniclabs T&M testmanager
version: 0.0.4
version: 1.0.0
type: application
maintainers:
- name: cdecatapult
url: cdecatapult.github.io/soniclabs-helmcharts
dependencies:
- name: postgresql
version: '^12.1.14'
version: '^12.x.x'
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
72 changes: 72 additions & 0 deletions charts/testmanager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# TestManager

## Parameters

### TestManager Parameters

| Name | Description | Value |
| -------------------------- | ----------------------------------------------------------------------- | ---------------- |
| `config.replicaCount` | The amount of containers to run | `1` |
| `config.type` | The type of service to create | `LoadBalancer` |
| `config.appPort` | The port to expose the service and application on | `8000` |
| `config.nodePort` | The nodePort to use if the the service type is LoadBalancer or NodePort | `30342` |
| `config.commonAnnotations` | The annotations to set on the Test Manager application | `{}` |
| `config.debug` | Whether or not to enable debug mode for the application | `False` |
| `config.logLevel` | The log level to use for the application | `debug` |
| `config.gui.host` | The hostname of the GUI service | `portal` |
| `config.gui.port` | The port of the GUI service | `8000` |
| `config.sma.host` | The hostname of the Suite Manager service | `suitemanager` |
| `config.sma.port` | The port of the Suite Manager service | `8000` |
| `config.cma.host` | The hostname of the Config Manager service | `configmanager` |
| `config.cma.port` | The port of the Config Manager service | `8000` |
| `config.rma.host` | The hostname of the Results Manager service | `resultsmanager` |
| `config.rma.port` | The port of the Results Manager service | `8000` |
| `config.apg.host` | The hostname of the API Gateway service | `apigateway` |
| `config.apg.port` | The port of the API Gateway service | `8000` |
| `config.dma.host` | The hostname of the Deploy Manager service | `deploymanager` |
| `config.dma.port` | The port of the Deploy Manager service | `8000` |
| `config.controlHost` | The hostname for the the Control TMA Host | `example` |
| `config.controlShare` | The name of the Samba Sharename on the Control TMA Host | `Public` |
| `config.controlUsername` | The username to use for the Control TMA Host | `username` |
| `config.controlPassword` | The password to use for the Control TMA Host | `password` |

### TestManager Image Parameters

| Name | Description | Value |
| ------------------- | -------------------------------------------------- | ---------------------------------------------- |
| `image.repository` | The repository to use for the Test Manager image | `ghcr.io/cdecatapult/soniclabs-testmanager-ts` |
| `image.pullPolicy` | The pull policy to use for the Test Manager image | `Always` |
| `image.tag` | The tag to use for the Test Manager image | `v0.0.12` |
| `image.pullSecrets` | The pull secrets to use for the Test Manager image | `["soniclabs"]` |

### TestManager Ingress parameters

| Name | Description | Value |
| --------------------------- | ---------------------------------------------------------------------- | ------------------- |
| `ingress.enabled` | Whether or not to enable the ingress for the Test Manager application | `true` |
| `ingress.annotations` | The annotations to set on the ingress for the Test Manager application | `{}` |
| `ingress.ingressClassName` | The ingress class to use for the Test Manager application | `""` |
| `ingress.hostname` | The hostname to use for the Test Manager application | `testmanager.local` |
| `ingress.paths` | The paths to use for the Test Manager application | |
| `ingress.paths[0].path` | The path to use for IoT tests in the Test Manager application | `/iot` |
| `ingress.paths[0].pathType` | The path type to use for Iot tests in the Test Manager application | `Prefix` |
| `ingress.paths[1].path` | The path to use for E2E tests in the Test Manager application | `/e2e` |
| `ingress.paths[1].pathType` | The path type to use for E2E tests in the Test Manager application | `Prefix` |

### TestManager ServiceAccount parameters

| Name | Description | Value |
| ---------------------------- | ----------------------------------------------------------------------- | ------- |
| `serviceAccount.create` | Whether or not to create a service account for the Test Manager service | `false` |
| `serviceAccount.annotations` | The annotations to use for the Test Manager service account | `{}` |
| `serviceAccount.name` | The name of the service account to use for the Test Manager service | `""` |

### TestManager PostgreSQL parameters

| Name | Description | Value |
| --------------------------------------------- | ----------------------------------------------------------------------------- | ------------- |
| `postgresql.enabled` | Whether or not to enable the PostgreSQL SubChart for the Test Manager service | `true` |
| `postgresql.primary.service.ports.postgresql` | The port to expose the PostgreSQL database service on | `5432` |
| `postgresql.auth.username` | The username to use for the PostgreSQL database | `tamuser` |
| `postgresql.auth.password` | The password to use for the PostgreSQL database | `tampassword` |
| `postgresql.auth.database` | The name of the database to use for the PostgreSQL database | `testmanager` |
25 changes: 0 additions & 25 deletions charts/testmanager/templates/configmap.yaml

This file was deleted.

101 changes: 83 additions & 18 deletions charts/testmanager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,35 @@ spec:
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- if .Values.config.commonAnnotations }}
{{- toYaml .Values.config.commonAnnotations | nindent 6 }}
{{- end }}
labels:
{{- include "testmanager.labels" . | nindent 8 }}
spec:
{{- include "testmanager.imagePullSecrets" . | indent 6 }}
initContainers:
- name: {{ include "testmanager.fullname" . }}-init
- name: {{ include "testmanager.fullname" . }}-db-init
image: {{ template "testmanager.image" .Values.image }}
command: ['sleep', '60']
command: ['npx', 'knex', 'migrate:latest', '--knexfile', 'build/lib/db/knexfile.js']
env:
- name: DB_HOST
value: {{ include "testmanager.postgresql.fullname" . }}
- name: DB_PORT
value: {{ .Values.postgresql.primary.service.ports.postgresql | quote }}
- name: DB_NAME
value: {{ .Values.postgresql.auth.database | quote }}
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: DB_USERNAME
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: DB_PASSWORD
containers:
- name: {{ include "testmanager.fullname" . }}-app
image: {{ template "testmanager.image" .Values.image }}
Expand All @@ -30,22 +49,68 @@ spec:
- containerPort: {{ .Values.config.appPort }}
livenessProbe:
httpGet:
path: /api/tma/healthchecks/readiness
path: /health
port: {{ .Values.config.appPort }}
initialDelaySeconds: 15
timeoutSeconds: 15
periodSeconds: 15
envFrom:
- configMapRef:
name: {{ include "testmanager.fullname" . }}-config
- secretRef:
name: {{ include "testmanager.fullname" . }}-secret
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: {{ .Values.config.appPort }}
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
env:
- name: HOST_IP
- name: APP_DEBUG
value: {{ .Values.config.debug | quote }}
- name: LOG_LEVEL
value: {{ .Values.config.logLevel | quote }}
- name: PORT
value: {{ .Values.config.appPort | quote }}
- name: DB_HOST
value: {{ include "testmanager.postgresql.fullname" . }}
- name: DB_PORT
value: {{ .Values.postgresql.primary.service.ports.postgresql | quote }}
- name: DB_NAME
value: {{ .Values.postgresql.auth.database | quote }}
- name: SUITE_HOST
value: {{ .Values.config.sma.host | quote }}
- name: SUITE_PORT
value: {{ .Values.config.sma.port | quote }}
- name: CONFIG_HOST
value: {{ .Values.config.cma.host | quote }}
- name: CONFIG_PORT
value: {{ .Values.config.cma.port | quote }}
- name: RESULTS_HOST
value: {{ .Values.config.rma.host | quote }}
- name: RESULTS_PORT
value: {{ .Values.config.rma.port | quote }}
- name: DEPLOY_HOST
value: {{ .Values.config.dma.host | quote }}
- name: DEPLOY_PORT
value: {{ .Values.config.dma.port | quote }}
- name: CONTROL_HOST
value: {{ .Values.config.controlHost | quote }}
- name: CONTROL_SHARENAME
value: {{ .Values.config.controlShare | quote }}
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: DB_USERNAME
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: DB_PASSWORD
- name: CONTROL_USERNAME
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: POD_IP
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: CONTROL_USERNAME
- name: CONTROL_PASSWORD
valueFrom:
fieldRef:
fieldPath: status.podIP
secretKeyRef:
name: {{ include "testmanager.fullname" . }}-secret
key: CONTROL_PASSWORD
6 changes: 4 additions & 2 deletions charts/testmanager/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ metadata:
{{- include "testmanager.labels" . | nindent 4 }}
type: Opaque
data:
POSTGRES_PASSWORD: {{ .Values.postgresql.auth.password | b64enc | quote }}
POSTGRES_USER: {{ .Values.postgresql.auth.username | b64enc | quote }}
DB_PASSWORD: {{ .Values.postgresql.auth.password | b64enc | quote }}
DB_USERNAME: {{ .Values.postgresql.auth.username | b64enc | quote }}
CONTROL_USERNAME: {{ .Values.config.controlUsername | b64enc | quote }}
CONTROL_PASSWORD: {{ .Values.config.controlPassword | b64enc | quote }}
Loading

0 comments on commit 4501155

Please sign in to comment.