zalf-rdm / geonode-k8s

A Kubernetes helm chart for the geospacial webapplication Geonode
https://geonode-k8s.readthedocs.io/en/latest/
GNU General Public License v2.0
13 stars 7 forks source link

[Fixes #105] Task:make postgres operator installation optional #150

Closed mwallschlaeger closed 7 months ago

mwallschlaeger commented 7 months ago

Description

CHANGED VALUES.YAML. This may not be compatible with previous versions.

This issue target the situation that you already have a postgres-operator running in your cluster and want to use it without using the external database configuration in geonode-k8s.

So from now on user can choose what kind of postgres type the gonna use by setting the postgres.type variable ether to operator or external. If your're using the operator you can further decide to install the postgres-operator into your cluster by setting the postgres-operator.enabled = True, if not geonode-k8s expects a postgres operator to be available inside your cluster. When setting postgres.type to external you need to set your database passwords inside the values.yaml like describe in docs/external_database or provide an self spinned secret set defined in: postgres.external.secret.existingSecretName.

  1. operator example without installing the operator when installing geonode-k8s:
    
    postgres-operator:
    enabled: False

postgres: type: operator operator: storageSize: 2Gi numberOfInstances: 1 postgres_version: 15

2. operator example **with** installing the operator when installing geonode-k8s (default in minikube-values.yaml):

postgres-operator: enabled: True

postgres: type: operator operator: storageSize: 2Gi numberOfInstances: 1 postgres_version: 15

3. external example setting db passwords in values.yaml (default in minikube-values-external-db.yaml):

postgres: type: external username: postgres geonode_databasename_and_username: geonode geodata_databasename_and_username: geodata

external: hostname: "external-postgres.com" port: 5432 secret: postgres_password: please-fill-out geonode_password: please-fill-out geodata_password: please-fill-out

postgres-operator: enabled: False

4. external example setting db passwords in beforehand configured secret:

postgres: type: external username: postgres geonode_databasename_and_username: geonode geodata_databasename_and_username: geodata

external: hostname: "external-postgres.com" port: 5432 secret: existingSecretName: "geonode-postgres-db-passwords"

postgres-operator: enabled: False



## Type of Change

Please select the relevant option:

- [ ] Bug fix
- [x] New feature
- [x] Documentation update
- [x] Refactoring
- [ ] Other (please describe)

## Related Issue

If there is an existing issue related to this pull request, please reference it here.

closes #105 

## Checklist

Please ensure that your pull request meets the following requirements:

- The pull request is limited to one type (docs, feature, bug fix, etc.)
- The pull request is as small as possible. Consider opening multiple pull requests instead of one large one.
- The feature or bug fix has been discussed and documented in an issue beforehand.

## Additional Notes

Any additional information or context regarding the pull request can be provided here.

Thank you for creating this pull request
gitguardian[bot] commented 7 months ago

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [9671131](https://dashboard.gitguardian.com/incidents/9671131?occurrence=125479744) | Triggered | Generic Database Assignment | 1a6c222dbb715d6d0228bdb495b82050259fa26e | minikube-values-external-db.yaml | [View secret](https://github.com/zalf-rdm/geonode-k8s/commit/1a6c222dbb715d6d0228bdb495b82050259fa26e#diff-d94c8b2e290a094012c552dfd3cb4376a8130ec1c0ebabb8676356abbf60fccbR51) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_database_assignment#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

AlexGacon commented 7 months ago

Quite a breaking change but you documented it clearly. I would have avoid to bring not related stuff in the PR (like renaming unrelated fields or removing postgres operatore UI) but looking good to me.