Skip to content

Commit

Permalink
Add pgpool reconfigure-tls
Browse files Browse the repository at this point in the history
Signed-off-by: MobarakHsn <[email protected]>
  • Loading branch information
MobarakHsn authored and raihankhan committed Jul 29, 2024
1 parent 31fac68 commit 4c17e8d
Show file tree
Hide file tree
Showing 14 changed files with 1,341 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/examples/pgpool/reconfigure-tls/issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: pgpool-issuer
namespace: demo
spec:
ca:
secretName: pgpool-ca
12 changes: 12 additions & 0 deletions docs/examples/pgpool/reconfigure-tls/pgpool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool
namespace: demo
spec:
version: "4.5.0"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/pgpool/restart/ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgpoolOpsRequest
metadata:
name: restart-pgpool
namespace: demo
spec:
type: Restart
databaseRef:
name: pgpool
timeout: 3m
apply: Always
12 changes: 12 additions & 0 deletions docs/examples/pgpool/restart/pgpool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
10 changes: 10 additions & 0 deletions docs/guides/pgpool/reconfigure-tls/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Reconfigure Pgpool TLS/SSL
menu:
docs_{{ .version }}:
identifier: pp-reconfigure-tls
name: Reconfigure TLS/SSL
parent: pp-pgpool-guides
weight: 46
menu_name: docs_{{ .version }}
---
54 changes: 54 additions & 0 deletions docs/guides/pgpool/reconfigure-tls/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Reconfiguring TLS of Pgpool
menu:
docs_{{ .version }}:
identifier: pp-reconfigure-tls-overview
name: Overview
parent: pp-reconfigure-tls
weight: 10
menu_name: docs_{{ .version }}
section_menu_id: guides
---

> New to KubeDB? Please start [here](/docs/README.md).
# Reconfiguring TLS of Pgpool

This guide will give an overview on how KubeDB Ops-manager operator reconfigures TLS configuration i.e. add TLS, remove TLS, update issuer/cluster issuer or Certificates and rotate the certificates of a `Pgpool`.

## Before You Begin

- You should be familiar with the following `KubeDB` concepts:
- [Pgpool](/docs/guides/pgpool/concepts/pgpool.md)
- [PgpoolOpsRequest](/docs/guides/pgpool/concepts/opsrequest.md)

## How Reconfiguring Pgpool TLS Configuration Process Works

The following diagram shows how KubeDB Ops-manager operator reconfigures TLS of a `Pgpool`. Open the image in a new tab to see the enlarged version.

<figure align="center">
  <img alt="Reconfiguring TLS process of Pgpool" src="/docs/images/day-2-operation/pgpool/pp-reconfigure-tls.png">
<figcaption align="center">Fig: Reconfiguring TLS process of Pgpool</figcaption>
</figure>

The Reconfiguring Pgpool TLS process consists of the following steps:

1. At first, a user creates a `Pgpool` Custom Resource Object (CRO).

2. `KubeDB` Provisioner operator watches the `Pgpool` CRO.

3. When the operator finds a `Pgpool` CR, it creates `PetSet` and related necessary stuff like secrets, services, etc.

4. Then, in order to reconfigure the TLS configuration of the `Pgpool` the user creates a `PgpoolOpsRequest` CR with desired information.

5. `KubeDB` Ops-manager operator watches the `PgpoolOpsRequest` CR.

6. When it finds a `PgpoolOpsRequest` CR, it pauses the `Pgpool` object which is referred from the `PgpoolOpsRequest`. So, the `KubeDB` Provisioner operator doesn't perform any operations on the `Pgpool` object during the reconfiguring TLS process.

7. Then the `KubeDB` Ops-manager operator will add, remove, update or rotate TLS configuration based on the Ops Request yaml.

8. Then the `KubeDB` Ops-manager operator will restart all the Pods of the pgpool so that they restart with the new TLS configuration defined in the `PgpoolOpsRequest` CR.

9. After the successful reconfiguring of the `Pgpool` TLS, the `KubeDB` Ops-manager operator resumes the `Pgpool` object so that the `KubeDB` Provisioner operator resumes its usual operations.

In the next docs, we are going to show a step-by-step guide on reconfiguring TLS configuration of a Pgpool using `PgpoolOpsRequest` CRD.
Loading

0 comments on commit 4c17e8d

Please sign in to comment.