Skip to content

Commit 7b8cb2e

Browse files
author
Yannic Nevado Hidalgo
committed
finally working setup after upgrading rancher, rancheros and kubernetesgit add .
1 parent f5762d7 commit 7b8cb2e

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Readme.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,38 @@ The installation will be executed by applying manifests in a specific order, bas
2626

2727
```shell
2828
# operator configuration
29-
$ kubectl create -f manifests/configmap.yaml --namespace zalando-postgres
29+
kubectl create -f manifests/configmap.yaml --namespace zalando-postgres
3030
# identity and permissions
31-
$ kubectl create -f manifests/operator-service-account-rbac.yaml --namespace zalando-postgres
31+
kubectl create -f manifests/operator-service-account-rbac.yaml --namespace zalando-postgres
3232
# deploy operator to K8s
33-
$ kubectl create -f manifests/postgres-operator.yaml --namespace zalando-postgres
33+
kubectl create -f manifests/postgres-operator.yaml --namespace zalando-postgres
3434
```
3535

3636
### Check operator status
3737

3838
* get all pods in the `namespace zalando-postgres` with the operator label `name=postgres-operator`
3939

4040
```shell
41-
$ kubectl get pod -l name=postgres-operator --namespace zalando-postgres
41+
kubectl get pod -l name=postgres-operator --namespace zalando-postgres
4242
```
4343

4444
### Create Postgres cluster
4545

4646
* create a Postgres cluster from [postgres manifest](https://github.com/yanehi/custom-postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml) with the specified values, like databases, users and *postgresql.conf* parameters
4747

4848
```shell
49-
$ kubectl create -f manifests/minimal-postgres-manifest.yaml --namespace zalando-postgres
49+
kubectl create -f manifests/minimal-postgres-manifest.yaml --namespace zalando-postgres
5050
```
5151

5252
### Check Postgres cluster status
5353

5454
```shell
5555
# check the deployed cluster
56-
$ kubectl get postgresql
56+
kubectl get postgresql
5757
# check created database pods with spilo-role (master, replica)
58-
$ kubectl get pods -l application=spilo -L spilo-role --namespace zalando-postgres
58+
kubectl get pods -l application=spilo -L spilo-role --namespace zalando-postgres
5959
# check created service resources and get ext. loadbalancer ip and port
60-
$ kubectl get svc -l application=spilo -L spilo-role --namespace zalando-postgres
60+
kubectl get svc -l application=spilo -L spilo-role --namespace zalando-postgres
6161
```
6262

6363
### Update Pod Manifest
@@ -74,13 +74,13 @@ You can update the Postgres cluster with the *manifest file* or directly with *p
7474
* required `pg_hba.conf` entry for the external LoadBalancer IP
7575

7676
```shell
77-
$ psql -h <LoadBalancer-IP> -p <LoadBalancer-Port> -d <databasename> -U <databaseuser>
77+
psql -h <LoadBalancer-IP> -p <LoadBalancer-Port> -d <databasename> -U <databaseuser>
7878
```
7979

8080
* connect directly from shell in Rancher
8181

8282
```shell
83-
$ psql -d <databasename> -U <databaseuser>
83+
psql -d <databasename> -U <databaseuser>
8484
```
8585

8686
### Delete Postgres Cluster

manifests/minimal-postgres-manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
storageClass: standard
2020
# number of pods
2121
# 1 is master, others replicas
22-
numberOfInstances: 2
22+
numberOfInstances: 3
2323
# define some users with access rights
2424
users:
2525
zalando: # database owner

manifests/postgres-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
# every postgres-operator Deployment Pod contains one container
2222
containers:
2323
- name: postgres-operator
24-
image: registry.opensource.zalan.do/acid/postgres-operator:v1.2.0
24+
image: registry.opensource.zalan.do/acid/postgres-operator:latest
2525
imagePullPolicy: IfNotPresent
2626
# set requested and limited resources for the container
2727
resources:

reset_postgres_operator_setup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ kubectl delete configmaps postgres-operator -n zalando-postgres
1414

1515
kubectl delete postgresql acid-minimal-cluster --namespace zalando-postgres
1616

17-
kubectl delete service acid-minimal-cluster acid-minimal-cluster-repl -n zalando-postgres
17+
kubectl delete service acid-minimal-cluster acid-minimal-cluster-repl -n zalando-postgres
18+
19+
kubectl delete poddisruptionbudgets postgres-acid-minimal-cluster-pdb -n zalando-postgres

0 commit comments

Comments
 (0)