Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add db connection details to celery deployments #28

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ env:
APP_NAME: ${{ secrets.APP_NAME }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
API_HOST: ${{ secrets.API_HOST }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB: ${{ secrets.DB }}
ES_HOST: ${{ secrets.ES_HOST }}
ES_HOSTS: ${{ secrets.ES_HOSTS }}
ES_USER: ${{ secrets.ES_USER }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_PORT: ${{ secrets.ES_PORT }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
DEBUG: ${{ secrets.DEBUG }}
Expand All @@ -44,7 +47,7 @@ env:
jobs:
deploy_to_testing:
name: Deploy testing server to google kubernetes engine
if: ${{ github.ref == 'refs/heads/develop'}}
if: ${{ github.ref == 'refs/heads/celery-fixes'}}
runs-on: ubuntu-latest
environment:
name: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ spec:
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.redisHost | quote }}
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.app.container.env.redisPort | quote }}
value: {{ .Values.service.backendport | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,43 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}

- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,43 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}

- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,44 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}


- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,43 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}

- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,43 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}

- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,55 @@ spec:
value: {{ .Values.app.container.env.redisPort | quote }}

- name: DEBUG
value: {{ .Values.app.container.env.debug | quote }}
value: {{ .Values.app.container.env.debug | quote }}

- name: DB_HOST
value: {{ .Values.app.container.env.dbHost | quote }}

- name: DB_PORT
value: {{ .Values.app.container.env.dbPort | quote }}

- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: DB_PASSWORD
value: {{ .Values.app.container.env.dbPassword | quote }}

- name: API_HOST
value: {{ .Values.app.container.env.apiHost | quote }}

- name: API_PORT
value: {{ .Values.service.backendport | quote }}

- name: ES_HOSTS
value: {{ .Values.app.container.env.elasticSearchHost | quote }}

- name: ES_USER
value: {{ .Values.app.container.env.elasticSearchUser | quote }}

- name: ES_PASSWORD
value: {{ .Values.app.container.env.elasticSearchPassword | quote }}

- name: ES_SCHEME
value: "https"

- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.2
command: [
"/cloud_sql_proxy",
"-instances={{ .Values.app.container.env.databaseInstanceConnectionName }}=tcp:5432",
"-credential_file={{ .Values.app.container.env.googleApplicationCredentialsSecret.filePath }}"]

securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: false

volumeMounts:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
mountPath: {{ .Values.app.container.env.googleApplicationCredentialsSecret.mountPath }}
readOnly: true

volumes:
- name: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
secret:
secretName: {{ .Values.app.container.env.googleApplicationCredentialsSecret.name }}
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ spec:
- name: DB
value: {{ .Values.app.container.env.db | quote }}

- name: ES_HOST
- name: ES_HOSTS
value: {{ .Values.app.container.env.elasticSearchHost | quote }}

- name: ES_PORT
value: {{ .Values.app.container.env.elasticSearchPort | quote }}
- name: ES_USER
value: {{ .Values.app.container.env.elasticSearchUser | quote }}

- name: ES_PASSWORD
value: {{ .Values.app.container.env.elasticSearchPassword | quote }}

- name: ES_SCHEME
value: "https"
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/openconceptlab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ image:
repository: openconceptlab/oclapi2
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "production"
tag: "qa"

oclweb:
port: 4000
Expand All @@ -28,7 +28,7 @@ oclweb:
repository: openconceptlab/oclweb2
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "production"
tag: "qa"

service:
type: NodePort
Expand Down
6 changes: 4 additions & 2 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ helm upgrade \
--set app.container.env.databaseInstanceConnectionName="${DB_INSTANCE_NAME}"\
--set app.container.env.redisHost="${REDIS_HOST}"\
--set app.container.env.redisPort="${REDIS_PORT}"\
--set app.container.env.apiHost="${API_HOST}"\
--set app.container.env.dbHost="${DB_HOST}"\
--set app.container.env.dbPort="${DB_PORT}"\
--set app.container.env.db="${DB}"\
--set app.container.env.dbPassword="${DB_PASSWORD}"\
--set app.container.env.elasticSearchHost="${ES_HOST}"\
--set app.container.env.elasticSearchPort="${ES_PORT}"\
--set app.container.env.elasticSearchHost="${ES_HOSTS}"\
--set app.container.env.elasticSearchUser="${ES_USER}"\
--set app.container.env.elasticSearchPassword="${ES_PASSWORD}"\
--set app.container.env.flowerPassword="${FLOWER_PASSWORD}"\
--set app.container.env.flowerUser="${FLOWER_USER}"\
--set app.container.env.flowerHost="${FLOWER_HOST}"\
Expand Down
Loading