Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions docs/doks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Install Percona Operator for PostgreSQL on Digital Ocean Kubernetes Service (DOKS)

This guide shows you how to deploy Percona Operator for PostgreSQL on Digital Ocean Kubernetes Service (DOKS) with default parameters.

The document assumes some experience with the
platform. For more information on the DOKS, see the [Digital Ocean Kubernetes Service official documentation :octicons-link-external-16:](https://docs.digitalocean.com/products/kubernetes/).


--8<-- "what-you-install.txt"

To customize the installation, refer to [Install Percona Operator for PostgreSQL with customized parameters](custom-install.md).

## Prerequisites

Install and configure the following:

1. [`doctl` Command Line Interface (CLI) :octicons-link-external-16:](https://docs.digitalocean.com/reference/doctl/how-to/install/) to manage DOKS clusters.
2. A [Digital Ocean personal access token :octicons-link-external-16:](https://docs.digitalocean.com/reference/api/create-personal-access-token/) to grant account access to `doctl`
3. [kubectl :octicons-link-external-16:](https://cloud.google.com/kubernetes-engine/docs/quickstart#choosing_a_shell) to manage Kubernetes resources.

## Create a DOKS cluster

1. Decide on the following:

* Cluster name.
* Region where you will deploy the cluster
* Kubernetes version
* A [node pool](https://docs.digitalocean.com/products/kubernetes/how-to/add-node-pools/) for the cluster to reside on.

2. Create a Digital Ocean cluster following the [official documentation :octicons-link-external-16:](https://docs.digitalocean.com/products/kubernetes/how-to/create-clusters/).
3. Add authentication token or a certificate to your kubectl configuration file to connect. Follow [official documentation :octicons-link-external-16:](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/) for steps

## Install the Operator deployment

1. Create a namespace for your cluster and export it as an environment variable to simplify further configuration:

```bash
kubectl create namespace <namespace>
export NAMESPACE=<namespace>
```

2. Create the Custom Resource Definition, set up RBAC, and install the Operator Deployment using the the bundle file:

```bash
kubectl apply --server-side -f https://raw.githubusercontent.com/percona/percona-postgresql-operator/v{{ release }}/deploy/bundle.yaml -n $NAMESPACE
```

??? example "Expected output"

--8<-- "kubectl-apply-bundle-response.txt"

As the result you will have the Operator Pod up and running.

## Install Percona Distribution for PostgreSQL

1. Create the Percona Distribution for PostgreSQL cluster:

```bash
kubectl apply -f https://raw.githubusercontent.com/percona/percona-postgresql-operator/v{{ release }}/deploy/cr.yaml -n $NAMESPACE
```

??? example "Expected output"

``` {.text .no-copy}
perconapgcluster.pgv2.percona.com/cluster1 created
```

2. Check the cluster status. Creation may take a few minutes:

```bash
kubectl get pg -n $NAMESPACE
```

??? example "Expected output"

--8<-- "kubectl-get-pg-response.txt"

## Verifying the cluster operation

When creation process is over, `kubectl get pg` command will show you the
cluster status as `ready`, and you can try to connect to the cluster.

{% include 'assets/fragments/connectivity.txt' %}

## Delete the DOKS cluster

To delete the DOKS cluster, run the following command:

```bash
doctl kubernetes cluster delete <cluster-name>
```

The cluster deletion may take time.

!!! warning

After deleting the cluster, all data stored in it will be lost!

2 changes: 1 addition & 1 deletion docs/eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Also, you need to configure AWS CLI with your credentials according to the

* name of your EKS cluster,
* AWS region in which you wish to deploy your cluster,
* the amount of nodes you would like tho have,
* the amount of nodes you would like to have,
* the desired ratio between [on-demand :octicons-link-external-16:](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-on-demand-instances.html)
and [spot :octicons-link-external-16:](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)
instances in the total number of nodes.
Expand Down
1 change: 1 addition & 0 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ nav:
- "Install on Amazon Elastic Kubernetes Service (AWS EKS)": eks.md
- "Install on Microsoft Azure Kubernetes Service (AKS)": aks.md
- "Install on OpenShift": openshift.md
- "Install on Digital Ocean Kubernetes Service (DOKS)": doks.md
- "Generic Kubernetes installation": kubernetes.md
- Configuration:
- "Application and system users": users.md
Expand Down