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

fixing support for an external postgresql database with helm deployment #3779

Merged
merged 4 commits into from
Nov 2, 2021

Conversation

shortcipher3
Copy link
Contributor

Motivation and context

The helm chart documentation describes steps for using your own postgresql database as follows:

I want to use my own postgresql/redis with your chart.
Just set postgresql.enabled or redis.enabled to false, as described below. 

When redis.enabled is set to false the environment variables are changed in the cvat_backend/deployment.yaml, but when postgresql.enabled is set to false the postgres environment variables are not changed.

I made a small change that reads the settings from the yaml file for the external database.

How has this been tested?

Built with enabled set to false without the change and examined the environment variables of the cvat_backend service. Then applied my changes and rebuilt and re-examined, confirmed the variables were using my settings with my code changes, but did not use my external db settings without my code changes.

To check my environment variables I ran:

$ HELM_RELEASE_NAMESPACE="<insert>"
$ HELM_RELEASE_NAME="<insert>"
$ BACKEND_POD_NAME=$(kubectl get pod --namespace $HELM_RELEASE_NAMESPACE -l tier=backend,app.kubernetes.io/instance=$HELM_RELEASE_NAME -o jsonpath='{.items[0].metadata.name}')
$ kubectl exec -it --namespace $HELM_RELEASE_NAMESPACE $BACKEND_POD_NAME -c cvat-backend-app-container -- bash
$ env | grep -i postgres

Also without these changes I was unable to successfully run:

kubectl exec -it --namespace $HELM_RELEASE_NAMESPACE $BACKEND_POD_NAME -c cvat-backend-app-container -- python manage.py createsuperuser

I was getting a database error.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@azhavoro
Copy link
Contributor

azhavoro commented Nov 1, 2021

@shortcipher3 Hello, thanks for the contribution! Could you please add a note to the changelog file about your change?

@shortcipher3
Copy link
Contributor Author

@shortcipher3 Hello, thanks for the contribution! Could you please add a note to the changelog file about your change?

done!

@azhavoro azhavoro self-requested a review November 2, 2021 10:40
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shortcipher3 , thanks again! Your contribution into the project is awesome. 👍

@nmanovic nmanovic merged commit 78363b8 into cvat-ai:develop Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants