Skip to content

Commit

Permalink
Add fullnameOverride to default values and allow external mongodb (#56)
Browse files Browse the repository at this point in the history
* Add fullnameOverride to values

* Increase chart version

* Further mongodb tweaks after testing
  • Loading branch information
tico24 authored Jun 22, 2021
1 parent 5290c43 commit 8788ad1
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/sorry-cypress/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sorry-cypress
description: A Helm chart for Sorry Cypress
type: application
version: 1.0.0
version: 1.0.1
appVersion: 1.0.3
home: https://sorry-cypress.dev/
sources:
Expand All @@ -19,4 +19,4 @@ dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 10.19.0
condition: mongodb.enabled
condition: mongodb.internal_db.enabled
11 changes: 9 additions & 2 deletions charts/sorry-cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documen
## Configuration

The following table lists the configurable parameters of the sorry-cypress chart and their default values.
### Helm Chart

https://sorry-cypress.dev/api#configuration

| Parameter | Description | Default |
|---------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------|
| `.fullnameOverride` | Allows you to override the name of the chart. | `` |
### API service

https://sorry-cypress.dev/api#configuration
Expand Down Expand Up @@ -141,9 +147,10 @@ If the execution driver is set to `"../execution/mongo/driver"`, you may enable

| Parameter | Description | Default |
|--------------------------------|------------------------------------------------------------------------------------|-----------------|
| `mongodb.enabled` | If enabled, it will deploy the internal MongoDB service. | `true` |
| `mongodb.internal_db.enabled` | If enabled, it will deploy the internal MongoDB service. | `true` |
| `mongodb.external_db.enabled` | If enabled, it will allow you to use an external mongodb | `false` |
| `mongodb.external_db.mongoServer`| The mongo server when providing an external one. Use it with `mongo.enabled=false` | `""` |
| `mongodb.mongoDatabase` | The mongo database | `sorry-cypress` |
| `mongodb.mongoServer` | The mongo server when providing an external one. Use it with `mongo.enabled=false` | `""` |

All other mongodb options are defined in [the Bitnami mongo db helm chart](https://github.com/bitnami/charts/blob/master/bitnami/mongodb/values.yaml).

Expand Down
Binary file added charts/sorry-cypress/charts/minio-8.0.9.tgz
Binary file not shown.
Binary file added charts/sorry-cypress/charts/mongodb-10.19.0.tgz
Binary file not shown.
3 changes: 2 additions & 1 deletion charts/sorry-cypress/ci/isolated-director-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dashboard:
enabled: false

mongodb:
enabled: false
internal_db:
enabled: false
4 changes: 2 additions & 2 deletions charts/sorry-cypress/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ Create the s3 secret
Determine the MongoDB hostname.
*/}}
{{- define "mongodb.hostname" -}}
{{- if .Values.mongodb.enabled }}
{{- if .Values.mongodb.internal_db.enabled }}
{{- if eq .Values.mongodb.architecture "standalone" }}
{{- printf "%s-%s" (include "sorry-cypress-helm.fullname" .) "mongodb" -}}
{{- else }}
{{- printf "%s-%s" (include "sorry-cypress-helm.fullname" .) "mongodb-0" -}}
{{- end }}
{{- else }}
{{- printf "%s" .Values.mongodb.mongoServer -}}
{{- printf "%s" .Values.mongodb.external_db.mongoServer -}}
{{- end }}
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion charts/sorry-cypress/templates/deployment-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
{{- end }}
containers:
- env:
{{- if .Values.mongodb.enabled }}
{{- if or (.Values.mongodb.internal_db.enabled) (.Values.mongodb.external_db.enabled) }}
- name: MONGODB_DATABASE
value: {{ .Values.mongodb.mongoDatabase }}
- name: MONGODB_URI
Expand Down
2 changes: 1 addition & 1 deletion charts/sorry-cypress/templates/test/test-connections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
args: ['{{ include "sorry-cypress-helm.fullname" . }}-director:{{ .Values.director.service.port }}']
restartPolicy: Never
---
{{- if .Values.mongodb.enabled }}
{{- if .Values.mongodb.internal_db.enabled }}
apiVersion: v1
kind: Pod
metadata:
Expand Down
18 changes: 14 additions & 4 deletions charts/sorry-cypress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# If you don't want to use the default release name, change it here.
# fullnameOverride: "sorry-cypress"

api:
image:
repository: agoldis/sorry-cypress-api
Expand Down Expand Up @@ -65,7 +68,7 @@ dashboard:
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"

# If you have no need for the Dashboard service, you can set this to false to exclude it
# If you have no need for the Dashboard service, you can set this to false to exclude it.
enabled: true

resources: {}
Expand Down Expand Up @@ -184,10 +187,17 @@ director:

mongodb:
# You need to ensure that director.environmentVariables.executionDriver is set to "../execution/mongo/driver" if you want the director to use mongodb.
enabled: true

# Set this to "true" if you wish to use your own external mongodb.
external_db:
enabled: false
mongoServer: ""

# Set this to "true" if you want this chart to deploy mongodb for you.
internal_db:
enabled: true

mongoDatabase: "sorry-cypress"
# Ignored if mongo.enabled is set to true
mongoServer: ""

# If enabled, you can use any values from the mongodb helm chart: https://github.com/bitnami/charts/blob/master/bitnami/mongodb/values.yaml
# Below are the bare minimim to get you started.
Expand Down

0 comments on commit 8788ad1

Please sign in to comment.