Skip to content

Commit

Permalink
docs: update db secret information
Browse files Browse the repository at this point in the history
  • Loading branch information
tjorbo committed Oct 1, 2024
1 parent d808e16 commit fa4fadc
Showing 1 changed file with 48 additions and 46 deletions.
94 changes: 48 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,8 @@ minikube tunnel
CoreDNS.
* For production usage, may use an own postgres instance. (Recommended, use
the [Cloud Native PG Operator](https://cloudnative-pg.io) in Kubernetes)
*

### Installation & upgrade steps

1. Prepare the value files.
2. Install the helm charts with `helm install ...` CLI Command:

```bash
helm upgrade --install -n tf --create-namespace tf1 terminfinder-chart
helm list -n tf
watch kubectl get pod,deploy,pvc,svc,ing,ep -n tf
```

### Debug Container

```bash
$ kubectl run -i --tty --rm debug --image=busybox -n terminfinder-demo --restart=Never
```

### Delete Release, pvc, and namespace

To delete the helm chart (release), use the `helm uninstall...` command.

Note that the persistent volume may be available even if the helm release is uninstalled.

```bash
$ helm uninstall tf1 -n tf
$ kubectl delete pvc --all -n tf
$ kubectl delete namespace tf
```

## Using an own PostgreSQL DB instance
### Using an own PostgreSQL DB instance

The helm chart deployment of the `terminfinder-frontend` will be kept untouched.

Expand All @@ -78,11 +48,18 @@ the following configuration to you `values.yaml` of the backend helm installatio

```yaml
terminfinder-backend:
externalDatabase:
enabled: true
address: <your-custom-value>
port: <your-custom-value>
database: <your-custom-value>
username: <your-custom-value>
existingSecret: terminfinder-backend-custom-postgresql
secretKeys:
userPasswordKey: key

postgresql:
enabled: false

# Or configure it with the docs here:
# https://github.com/bitnami/charts/tree/main/bitnami/postgresql#parameters
```
Additionally, you should store credentials (of db user password) into a secret like that:
Expand All @@ -97,19 +74,44 @@ metadata:
app.kubernetes.io/name: postgresql
type: Opaque
data:
customPasswordKey: "secret"
key: "secret"
```
With this secret already deployed, you can modify the helm chart deployment of the `terminfinder-backend` on these
values:
#### Enable uuid-ossp extention
```yaml
terminfinder-backend:
postgresql:
auth:
username: <your-custom-username>
database: <your-custom-database>
existingSecret: terminfinder-backend-custom-postgresql
secretKeys:
userPasswordKey: customPasswordKey
A prerequisite for running the terminfinder backend is the postgresql extension `uuid-ossp`, which can be enabled by
running the command as db-admin:

```
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
ALTER EXTENSION "uuid-ossp" SET SCHEMA public;
```

### Installation & upgrade steps

1. Prepare the value files.
2. Install the helm charts with `helm install ...` CLI Command:

```bash
helm upgrade --install -n tf --create-namespace tf1 terminfinder-chart
helm list -n tf
watch kubectl get pod,deploy,pvc,svc,ing,ep -n tf
```

### Debug Container

```bash
$ kubectl run -i --tty --rm debug --image=busybox -n terminfinder-demo --restart=Never
```

### Delete Release, pvc, and namespace

To delete the helm chart (release), use the `helm uninstall...` command.

Note that the persistent volume may be available even if the helm release is uninstalled.

```bash
$ helm uninstall tf1 -n tf
$ kubectl delete pvc --all -n tf
$ kubectl delete namespace tf
```

0 comments on commit fa4fadc

Please sign in to comment.