Skip to content

Commit

Permalink
Add ability to disable API and dashboard deployments (#49)
Browse files Browse the repository at this point in the history
* add ability to disable API and dashboard deployments
  • Loading branch information
alyssaruth authored Jun 14, 2021
1 parent d81f9db commit c4c8c92
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 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-alpha
version: 1.0.0-alpha1
appVersion: 1.0.3
home: https://sorry-cypress.dev/
sources:
Expand Down
4 changes: 3 additions & 1 deletion charts/sorry-cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ https://sorry-cypress.dev/api#configuration
| `api.image.repository` | Image repository | `agoldis/sorry-cypress-api` |
| `api.image.tag` | Image tag | `` |
| `api.image.pullPolicy` | Image pull policy | `Always` |
| `api.enabled` | Whether to deploy the API service | `true` |
| `api.resources` | Resources to initialize the container | `{}` |
| `api.podAnnotations` | Set annotations for pods | `{}` |
| `api.podLabels` | Set additional labels for pods | `{}` |
Expand Down Expand Up @@ -89,6 +90,7 @@ https://sorry-cypress.dev/dashboard#configuration
| `dashboard.image.repository` | Image repository | `agoldis/sorry-cypress-dashboard` |
| `dashboard.image.tag` | Image tag | `` |
| `dashboard.image.pullPolicy` | Image pull policy | `Always` |
| `dashboard.enabled` | Whether to deploy the Dashboard service | `true` |
| `dashboard.resources` | Resources to initialize the container | `{}` |
| `dashboard.environmentVariables.ciUrl` | Set the `CI_URL` optional environment variable to add a link to your CI tool | `""` |
| `dashboard.environmentVariables.graphQlClientCredentials` | Set the `GRAPHQL_CLIENT_CREDENTIALS` environment variable to configure the API service client credentials. | `""` |
Expand Down Expand Up @@ -139,7 +141,7 @@ If the execution driver is set to `"../execution/mongo/driver"`, you may enable

| Parameter | Description | Default |
|--------------------------------|------------------------------------------------------------------------------------|-----------------|
| `mongo.enabled` | If enabled, it will deploy the internal MongoDB service. | `false` |
| `mongo.enabled` | If enabled, it will deploy the internal MongoDB service. | `true` |
| `mongo.mongoDatabase` | The mongo database | `sorry-cypress` |
| `mongo.mongoServer` | The mongo server when providing an external one. Use it with `mongo.enabled=false` | `""` |
| `mongo.image.repository` | Image repository | `mongo` |
Expand Down
10 changes: 10 additions & 0 deletions charts/sorry-cypress/ci/isolated-director-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Disables the API and dashboard for testing the director still works

api:
enabled: false

dashboard:
enabled: false

mongodb:
enabled: false
4 changes: 3 additions & 1 deletion charts/sorry-cypress/templates/deployment-api.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.api.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -59,4 +60,5 @@ spec:
{{- end }}
restartPolicy: Always
serviceAccountName: ""
volumes: null
volumes: null
{{- end }}
4 changes: 3 additions & 1 deletion charts/sorry-cypress/templates/deployment-dashboard.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.dashboard.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -65,4 +66,5 @@ spec:
{{- toYaml .Values.dashboard.resources | nindent 10 }}
restartPolicy: Always
serviceAccountName: ""
volumes: null
volumes: null
{{- end }}
4 changes: 3 additions & 1 deletion charts/sorry-cypress/templates/test/test-connections.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# A very basic set of tests to query that the appropriate services work and connect to a pod as long as they are enabled in the Vales.yaml file

{{- if .Values.dashboard.enabled }}
apiVersion: v1
kind: Pod
metadata:
Expand All @@ -16,6 +17,7 @@ spec:
command: ['wget']
args: ['{{ include "sorry-cypress-helm.fullname" . }}-dashboard:{{ .Values.dashboard.service.port }}']
restartPolicy: Never
{{- end }}
---
apiVersion: v1
kind: Pod
Expand Down Expand Up @@ -74,7 +76,7 @@ spec:
restartPolicy: Never
{{- end }}
---
{{- if .Values.api.readinessProbe.enabled }}
{{- if .Values.api.enabled }}
apiVersion: v1
kind: Pod
metadata:
Expand Down
6 changes: 6 additions & 0 deletions charts/sorry-cypress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ api:
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"

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

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down Expand Up @@ -63,6 +66,9 @@ 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
enabled: true

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit c4c8c92

Please sign in to comment.