Skip to content

Commit

Permalink
Merge pull request #30 from Raj-Adarsh/a4_helm_v3
Browse files Browse the repository at this point in the history
chore: added notes.txt for postgres
  • Loading branch information
girish332 authored Jun 21, 2024
2 parents 5db2ee8 + 02312c2 commit ed73aba
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions postgres/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#########################################################
# Postgres Helm Chart
#########################################################

1. **Release Information**
- Release Name: {{ .Release.Name }}
- Namespace: {{ .Release.Namespace }}
- Chart Version: {{ .Chart.Version }}
- App Version: {{ .Chart.AppVersion }}

2. **Service Information**
- Postgres Service: `postgres-svc`
- Port: `5432`

3. **Accessing the Database**
- To connect to the PostgreSQL database, you can use the following command:
```
kubectl run -it --rm --image=postgres:14 --restart=Never pg-client -- psql -h postgres-svc -U {{ .Values.postgresql.username }} -d {{ .Values.postgresql.database }}
```
- Replace `{{ .Values.postgresql.username }}` and `{{ .Values.postgresql.database }}` with the actual values from your `values.yaml`.

4. **Credentials**
- The PostgreSQL credentials are stored in the `postgres-credentials` secret.
- You can retrieve the credentials using the following commands:
```
kubectl get secret postgres-credentials -o jsonpath="{.data.POSTGRES_USER}" | base64 --decode
kubectl get secret postgres-credentials -o jsonpath="{.data.POSTGRES_PASSWORD}" | base64 --decode
kubectl get secret postgres-credentials -o jsonpath="{.data.POSTGRES_DB}" | base64 --decode
```

5. **Persistent Volume Claims**
- The PVC for PostgreSQL storage is named `postgres-storage-postgres-0`.
- StorageClass: `ebs-csi-encrypted`
- Size: `8Gi`

6. **Scaling**
- You can scale the PostgreSQL StatefulSet using the following command:
```
kubectl scale statefulset postgres --replicas=<new-replica-count> -n {{ .Release.Namespace }}
```

7. **Logs**
- To view the logs of the PostgreSQL pod, use the following command:
```
kubectl logs -f postgres-0 -n {{ .Release.Namespace }}
```

8. **Upgrading the Chart**
- To upgrade the Helm chart, use the following command:
```
helm upgrade {{ .Release.Name }} ./postgres -f values.yaml
```

9. **Uninstalling the Chart**
- To uninstall the Helm chart, use the following command:
```
helm uninstall {{ .Release.Name }} -n {{ .Release.Namespace }}
```

Thank you for using this PostgreSQL Helm Chart!

#########################################################

0 comments on commit ed73aba

Please sign in to comment.