From 11d74f0c5f0bfaa5e47ad2fc67a549ae420f253b Mon Sep 17 00:00:00 2001 From: David Blane <32327139+dblane-digicatapult@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:34:22 +0000 Subject: [PATCH] Added PVC for resultsmanager pcapStorage and envar (#40) * Added PVC for resultsmanager pcapStorage and envar --- charts/resultsmanager/Chart.yaml | 4 +- charts/resultsmanager/README.md | 48 ++++++++++--------- charts/resultsmanager/ci/ct-values.yaml | 4 ++ .../resultsmanager/templates/deployment.yaml | 9 ++++ charts/resultsmanager/templates/pvc.yaml | 13 +++++ charts/resultsmanager/values.yaml | 11 ++++- 6 files changed, 64 insertions(+), 25 deletions(-) create mode 100644 charts/resultsmanager/templates/pvc.yaml diff --git a/charts/resultsmanager/Chart.yaml b/charts/resultsmanager/Chart.yaml index 5e4b46b..bb87a15 100644 --- a/charts/resultsmanager/Chart.yaml +++ b/charts/resultsmanager/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: resultsmanager -appVersion: 1.2.0 +appVersion: 1.3.0 description: A generated Helm Chart for Soniclabs T&M resultsmanager -version: 1.0.2 +version: 1.0.3 type: application maintainers: - name: cdecatapult diff --git a/charts/resultsmanager/README.md b/charts/resultsmanager/README.md index cf96d3d..caaf9c3 100644 --- a/charts/resultsmanager/README.md +++ b/charts/resultsmanager/README.md @@ -4,27 +4,31 @@ ### ResultsManager 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 Results 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.tma.host` | The hostname of the Test Manager service | `testmanager` | -| `config.tma.port` | The port of the Test 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.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` | +| 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 Results Manager application | `{}` | +| `config.debug` | Whether or not to enable debug mode for the application | `False` | +| `config.pcapStorage.path` | The Location to store pcaps in and mount the PVC to | `/mnt/pcaps` | +| `config.pcapStorage.accessMode` | The access mode to use for the PCAP storage PVC | `ReadWriteMany` | +| `config.pcapStorage.size` | The path to use for the PCAP storage PVC | `100Gi` | +| `config.pcapStorage.storageClassName` | The storage class to use for the PCAP storage PVC | `azureFile` | +| `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.tma.host` | The hostname of the Test Manager service | `testmanager` | +| `config.tma.port` | The port of the Test 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.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` | ### ResultsManager Image Parameters @@ -32,7 +36,7 @@ | ------------------- | ----------------------------------------------------- | ---------------------------------------------- | | `image.repository` | The repository to use for the Results Manager image | `ghcr.io/cdecatapult/soniclabs-resultsmanager` | | `image.pullPolicy` | The pull policy to use for the Results Manager image | `Always` | -| `image.tag` | The tag to use for the Results Manager image | `v1.2.0` | +| `image.tag` | The tag to use for the Results Manager image | `v1.3.0` | | `image.pullSecrets` | The pull secrets to use for the Results Manager image | `["soniclabs"]` | ### ResultsManager Ingress parameters diff --git a/charts/resultsmanager/ci/ct-values.yaml b/charts/resultsmanager/ci/ct-values.yaml index 11c41be..10be4cd 100644 --- a/charts/resultsmanager/ci/ct-values.yaml +++ b/charts/resultsmanager/ci/ct-values.yaml @@ -1,2 +1,6 @@ config: type: ClusterIP + pcapStorage: + accessMode: ReadWriteOnce + size: 1Gi + storageClassName: "standard" diff --git a/charts/resultsmanager/templates/deployment.yaml b/charts/resultsmanager/templates/deployment.yaml index 9ac5335..b25c476 100644 --- a/charts/resultsmanager/templates/deployment.yaml +++ b/charts/resultsmanager/templates/deployment.yaml @@ -66,6 +66,8 @@ spec: value: {{ .Values.config.debug | quote }} - name: APP_LOG_LEVEL value: {{ .Values.config.logLevel | quote }} + - name: DATASTORE + value: {{ .Values.config.pcapStorage.path | quote }} - name: POSTGRES_HOST value: {{ include "resultsmanager.postgresql.fullname" . }} - name: POSTGRES_PORT @@ -102,3 +104,10 @@ spec: secretKeyRef: name: {{ include "resultsmanager.fullname" . }}-secret key: POSTGRES_PASSWORD + volumeMounts: + - name: pcap-storage + mountPath: {{ .Values.config.pcapStorage.path }} + volumes: + - name: pcap-storage + persistentVolumeClaim: + claimName: {{ include "resultsmanager.fullname" . }}-pcap-storage diff --git a/charts/resultsmanager/templates/pvc.yaml b/charts/resultsmanager/templates/pvc.yaml new file mode 100644 index 0000000..ac170a6 --- /dev/null +++ b/charts/resultsmanager/templates/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "resultsmanager.fullname" . }}-pcap-storage + labels: + {{- include "resultsmanager.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.config.pcapStorage.accessMode }} + resources: + requests: + storage: {{ .Values.config.pcapStorage.size | quote }} + storageClassName: {{ .Values.config.pcapStorage.storageClassName | quote }} diff --git a/charts/resultsmanager/values.yaml b/charts/resultsmanager/values.yaml index c94f77f..8d51399 100644 --- a/charts/resultsmanager/values.yaml +++ b/charts/resultsmanager/values.yaml @@ -13,6 +13,15 @@ config: commonAnnotations: {} ## @param config.debug Whether or not to enable debug mode for the application debug: "False" + pcapStorage: + ## @param config.pcapStorage.path The Location to store pcaps in and mount the PVC to + path: /mnt/pcaps + ## @param config.pcapStorage.accessMode The access mode to use for the PCAP storage PVC + accessMode: ReadWriteMany + ## @param config.pcapStorage.size The path to use for the PCAP storage PVC + size: 100Gi + ## @param config.pcapStorage.storageClassName The storage class to use for the PCAP storage PVC + storageClassName: azureFile ## @param config.logLevel The log level to use for the application logLevel: DEBUG gui: @@ -53,7 +62,7 @@ image: ## @param image.pullPolicy The pull policy to use for the Results Manager image pullPolicy: Always ## @param image.tag The tag to use for the Results Manager image - tag: v1.2.0 + tag: v1.3.0 ## @param image.pullSecrets The pull secrets to use for the Results Manager image pullSecrets: ['soniclabs']