Skip to content

Commit

Permalink
Fixed steps for postgresql example (#1779)
Browse files Browse the repository at this point in the history
- fixed kanctl installation link
- updated responses for actionset
  • Loading branch information
shahpratikr committed Dec 15, 2022
1 parent 2920955 commit e2bb2b0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
3 changes: 1 addition & 2 deletions docker/postgres-kanister-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM postgres:14-bullseye
LABEL maintainer="vkamra@kasten.io"
FROM postgres:15-bullseye

ENV DEBIAN_FRONTEND noninteractive

Expand Down
4 changes: 1 addition & 3 deletions docker/postgres-tools-9.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM postgres:14-bullseye

LABEL maintainer="vkamra@kasten.io"
FROM postgres:15-bullseye

ENV DEBIAN_FRONTEND noninteractive

Expand Down
2 changes: 1 addition & 1 deletion docker/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bitnami/postgresql:14.0.0
FROM bitnami/postgresql:15

USER root

Expand Down
31 changes: 23 additions & 8 deletions examples/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment

## Prerequisites

- Kubernetes 1.10+
- Kubernetes 1.20+
- PV provisioner support in the underlying infrastructure
- Kanister controller version 0.85.0 installed in your cluster
- Kanctl CLI installed (https://docs.kanister.io/tooling.html#kanctl)
- Kanctl CLI installed (https://docs.kanister.io/tooling.html#install-the-tools)

## Installing the Chart
To install the chart with the release name `my-release`:
Expand Down Expand Up @@ -141,8 +141,8 @@ $ kanctl create actionset --action backup --namespace kanister --blueprint postg
actionset backup-llfb8 created

$ kubectl --namespace kanister get actionsets.cr.kanister.io
NAME AGE
backup-glptq 38s
NAME PROGRESS LAST TRANSITION TIME STATE
backup-glptq 100.00 2022-12-08T18:14:09Z complete

# View the status of the actionset
$ kubectl --namespace kanister describe actionset backup-glptq
Expand Down Expand Up @@ -197,12 +197,22 @@ $ kanctl --namespace kanister create actionset --action restore --from backup-gl
actionset restore-backup-glptq-6jzt4 created

## Check status
$ kubectl --namespace kanister describe actionset restore-backup-glptq-6jzt4
$ kubectl --namespace kanister get actionset restore-backup-glptq-6jzt4
NAME PROGRESS LAST TRANSITION TIME STATE
restore-backup-glptq-6jzt4 100.00 2022-12-08T18:16:50Z complete
```

Once the ActionSet status is set to "complete", you can see that the data has been successfully restored to PostgreSQL

```bash
## Log in into postgresql container and get shell access
$ kubectl exec -ti my-release-postgresql-0 -n postgres-test -- bash

## use psql cli to add entries in postgresql database
$ PGPASSWORD=${POSTGRES_PASSWORD} psql -U postgres
psql (11.5)
Type "help" for help.

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
Expand Down Expand Up @@ -231,11 +241,13 @@ test=# select * from company;
The artifacts created by the backup action can be cleaned up using the following command:

```bash
$ kanctl --namespace kanister create actionset --action delete --from backup-glptq
$ kanctl --namespace kanister create actionset --action delete --from backup-glptq --namespacetargets kanister
actionset delete-backup-glptq-cq6bw created

# View the status of the ActionSet
$ kubectl --namespace kanister describe actionset delete-backup-glptq-cq6bw
$ kubectl --namespace kanister get actionset delete-backup-glptq-cq6bw
NAME PROGRESS LAST TRANSITION TIME STATE
delete-backup-glptq-cq6bw 100.00 2022-12-08T18:16:50Z complete
```

## Troubleshooting
Expand Down Expand Up @@ -264,13 +276,16 @@ $ helm delete my-release -n postgres-test
```

### Delete CRs
Remove Blueprint and Profile CR
Remove Blueprint, Profile CR and ActionSet

```bash
$ kubectl delete blueprints.cr.kanister.io postgres-bp -n kanister

$ kubectl get profiles.cr.kanister.io -n postgres-test
NAME AGE
s3-profile-7d6wt 17m

$ kubectl delete profiles.cr.kanister.io ss3-profile-7d6w -n postgres-test

$ kubectl delete actionset backup-glptq restore-backup-glptq-6jzt4 delete-backup-glptq-cq6bw -n kanister
```

0 comments on commit e2bb2b0

Please sign in to comment.