diff --git a/charts/testmanager/Chart.lock b/charts/testmanager/Chart.lock index fa114da..5166dbc 100644 --- a/charts/testmanager/Chart.lock +++ b/charts/testmanager/Chart.lock @@ -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" diff --git a/charts/testmanager/Chart.yaml b/charts/testmanager/Chart.yaml index ec37bd5..ef00f15 100644 --- a/charts/testmanager/Chart.yaml +++ b/charts/testmanager/Chart.yaml @@ -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 diff --git a/charts/testmanager/README.md b/charts/testmanager/README.md new file mode 100644 index 0000000..8991b6f --- /dev/null +++ b/charts/testmanager/README.md @@ -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` | diff --git a/charts/testmanager/templates/configmap.yaml b/charts/testmanager/templates/configmap.yaml deleted file mode 100644 index 3b9684f..0000000 --- a/charts/testmanager/templates/configmap.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "testmanager.fullname" . }}-config - labels: - {{- include "testmanager.labels" . | nindent 4 }} -data: - APP_DEBUG: {{ .Values.config.debug | quote }} - APP_LOG_LEVEL: {{ .Values.config.logLevel | quote }} - POSTGRES_HOST: {{ include "testmanager.postgresql.fullname" . }} - POSTGRES_DB: {{ .Values.postgresql.auth.database | quote }} - TAM_GUI_HOST: {{ .Values.config.guiHost | quote }} - TAM_GUI_PORT: {{ .Values.config.guiPort | quote }} - TAM_CONFIG_MANAGER_HOST: {{ .Values.config.cmaHost | quote }} - TAM_CONFIG_MANAGER_PORT: {{ .Values.config.cmaPort | quote }} - TAM_CASE_MANAGER_HOST: {{ .Values.config.camHost | quote }} - TAM_CASE_MANAGER_PORT: {{ .Values.config.camPort | quote }} - TAM_TEST_MANAGER_HOST: {{ .Values.config.tmaHost | quote }} - TAM_TEST_MANAGER_PORT: {{ .Values.config.tmaPort | quote }} - TAM_RESULTS_MANAGER_HOST: {{ .Values.config.rmaHost | quote }} - TAM_RESULTS_MANAGER_PORT: {{ .Values.config.rmaPort | quote }} - TAM_API_GATEWAY_HOST: {{ .Values.config.apgHost | quote }} - TAM_API_GATEWAY_PORT: {{ .Values.config.apgPort | quote }} - TAM_DEPLOY_MANAGER_HOST: {{ .Values.config.dmaHost | quote }} - TAM_DEPLOY_MANAGER_PORT: {{ .Values.config.dmaPort | quote }} diff --git a/charts/testmanager/templates/deployment.yaml b/charts/testmanager/templates/deployment.yaml index 7901960..3ed7e4e 100644 --- a/charts/testmanager/templates/deployment.yaml +++ b/charts/testmanager/templates/deployment.yaml @@ -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 }} @@ -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 diff --git a/charts/testmanager/templates/secrets.yaml b/charts/testmanager/templates/secrets.yaml index e493762..fb8ca54 100644 --- a/charts/testmanager/templates/secrets.yaml +++ b/charts/testmanager/templates/secrets.yaml @@ -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 }} diff --git a/charts/testmanager/values.yaml b/charts/testmanager/values.yaml index 15419e4..d2e39d9 100644 --- a/charts/testmanager/values.yaml +++ b/charts/testmanager/values.yaml @@ -1,45 +1,114 @@ -postgresql: - enabled: true - auth: - username: tamuser - password: tampassword - database: testmanager - +## @section TestManager Parameters +## config: +## @param config.replicaCount The amount of containers to run replicaCount: 1 - appPort: 8000 +## @param config.type The type of service to create type: LoadBalancer - nodePort: 30324 - debug: "True" - logLevel: DEBUG - guiHost: portal - guiPort: 8000 - cmaHost: configmanager - cmaPort: 8000 - camHost: casemanager - camPort: 8000 - tmaHost: testmanager - tmaPort: 8000 - rmaHost: resultsmanager - rmaPort: 8000 - apgHost: apigateway - apgPort: 8000 - dmaHost: deploymanager - dmaPort: 8000 + ## @param config.appPort The port to expose the service and application on + appPort: 8000 + ## @param config.nodePort The nodePort to use if the the service type is LoadBalancer or NodePort + nodePort: 30342 + ## @param config.commonAnnotations The annotations to set on the Test Manager application + commonAnnotations: {} + ## @param config.debug Whether or not to enable debug mode for the application + debug: "False" + ## @param config.logLevel The log level to use for the application + logLevel: debug + gui: + ## @param config.gui.host The hostname of the GUI service + host: portal + ## @param config.gui.port The port of the GUI service + port: 8000 + sma: + ## @param config.sma.host The hostname of the Suite Manager service + host: suitemanager + ## @param config.sma.port The port of the Suite Manager service + port: 8000 + cma: + ## @param config.cma.host The hostname of the Config Manager service + host: configmanager + ## @param config.cma.port The port of the Config Manager service + port: 8000 + rma: + ## @param config.rma.host The hostname of the Results Manager service + host: resultsmanager + ## @param config.rma.port The port of the Results Manager service + port: 8000 + apg: + ## @param config.apg.host The hostname of the API Gateway service + host: apigateway + ## @param config.apg.port The port of the API Gateway service + port: 8000 + dma: + ## @param config.dma.host The hostname of the Deploy Manager service + host: deploymanager + ## @param config.dma.port The port of the Deploy Manager service + port: 8000 + ## @param config.controlHost The hostname for the the Control TMA Host + controlHost: "example" + ## @param config.controlShare The name of the Samba Sharename on the Control TMA Host + controlShare: "Public" + ## @param config.controlUsername The username to use for the Control TMA Host + controlUsername: "username" + ## @param config.controlPassword The password to use for the Control TMA Host + controlPassword: "password" +## @section TestManager Image Parameters image: - repository: ghcr.io/cdecatapult/soniclabs-testmanager + ## @param image.repository The repository to use for the Test Manager image + repository: ghcr.io/cdecatapult/soniclabs-testmanager-ts + ## @param image.pullPolicy The pull policy to use for the Test Manager image pullPolicy: Always - tag: sha256:244f8164e526e99a1c9e634679b24fbbd38577e528eb219e0362514bac951324 + ## @param image.tag The tag to use for the Test Manager image + tag: v0.0.12 + ## @param image.pullSecrets The pull secrets to use for the Test Manager image pullSecrets: ['soniclabs'] -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 +## @section TestManager Ingress parameters +## +ingress: + ## @param ingress.enabled Whether or not to enable the ingress for the Test Manager application + enabled: true + ## @param ingress.annotations The annotations to set on the ingress for the Test Manager application + annotations: {} + ## @param ingress.ingressClassName The ingress class to use for the Test Manager application + ingressClassName: "" + ## @param ingress.hostname The hostname to use for the Test Manager application + hostname: testmanager.local + ## @extra ingress.paths The paths to use for the Test Manager application + paths: + ## @param ingress.paths[0].path The path to use for IoT tests in the Test Manager application + ## @param ingress.paths[0].pathType The path type to use for Iot tests in the Test Manager application + - path: /iot + pathType: Prefix + ## @param ingress.paths[1].path The path to use for E2E tests in the Test Manager application + ## @param ingress.paths[1].pathType The path type to use for E2E tests in the Test Manager application + - path: /e2e + pathType: Prefix +## @section TestManager ServiceAccount parameters serviceAccount: + ## @param serviceAccount.create Whether or not to create a service account for the Test Manager service create: false + ## @param serviceAccount.annotations The annotations to use for the Test Manager service account annotations: {} + ## @param serviceAccount.name The name of the service account to use for the Test Manager service name: "" + +## @section TestManager PostgreSQL parameters +postgresql: + ## @param postgresql.enabled Whether or not to enable the PostgreSQL SubChart for the Test Manager service + enabled: true + ## @param postgresql.primary.service.ports.postgresql The port to expose the PostgreSQL database service on + primary: + service: + ports: + postgresql: 5432 + auth: + ## @param postgresql.auth.username The username to use for the PostgreSQL database + username: tamuser + ## @param postgresql.auth.password The password to use for the PostgreSQL database + password: tampassword + ## @param postgresql.auth.database The name of the database to use for the PostgreSQL database + database: testmanager