Cloud Setup

This section describes how to orchestrate the deployment and management of a PostgreSQL High Availability cluster in a Kubernetes cluster in the public cloud using CustomResourceDefinitions such as Cluster. Like any other Kubernetes application, it is deployed using regular manifests written in YAML.

The Cloud Native PostgreSQL Operator is systematically tested on the following public cloud environments:

Below you can find specific instructions for each of the above environments. Once the steps described on this page have been completed, and your kubectl can connect to the desired cluster, you can install the operator and start creating PostgreSQL Clusters by following the instructions you find in the "Installation" section.

Important

kubectl is required to proceed with setup.

Microsoft Azure Kubernetes Service (AKS)

Follow the instructions contained in "Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal" available on the Microsoft documentation to set up your Kubernetes cluster in AKS.

In particular, you need to configure kubectl to connect to your Kubernetes cluster (called myAKSCluster using resources in myResourceGroup group) through the az aks get-credentials command. This command downloads the credentials and configures your kubectl to use them:

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

Note

You can change the name of the myAKSCluster cluster and the resource group myResourceGroup from the Azure portal.

You can use any of the storage classes that work with Azure disks:

  • default
  • managed-premium

About AKS storage classes

For more information and details on the available storage classes in AKS, please refer to the "Storage classes" section in the official documentation from Microsoft.

Amazon Elastic Kubernetes Service (EKS)

Follow the instructions contained in "Creating an Amazon EKS Cluster" available on the AWS documentation to set up your Kubernetes cluster in EKS.

Important

Keep in mind that Amazon puts limitations on how many pods a node can create. It depends on the type of instance that you choose to use when you create your cluster.

After the setup, kubectl should point to your newly created EKS cluster.

By default, a gp2 storage class is available after cluster creation. However, Amazon EKS offers multiple storage types that can be leveraged to create other storage classes for Clusters' volumes:

  • gp2: general-purpose SSD volume
  • io1: provisioned IOPS SSD
  • st1: throughput optimized HDD
  • sc1: cold HDD

About EKS storage classes

For more information and details on the available storage classes in EKS, please refer to the "Amazon EBS Volume Types" page in the official documentation for AWS and the "AWS-EBS" page in the Kubernetes documentation.

Google Kubernetes Engine (GKE)

Follow the instructions contained in "Creating a cluster" available on the Google Cloud documentation to set up your Kubernetes cluster in GKE.

Warning

Google Kubernetes Engine uses the deprecated kube-dns server instead of the recommended CoreDNS. To work with Cloud Native PostgreSQL Operator, you need to disable kube-dns and replace it with coredns.

To replace kube-dns with coredns in your GKE cluster, follow these instructions:

kubectl scale --replicas=0 deployment/kube-dns-autoscaler --namespace=kube-system
kubectl scale --replicas=0 deployment/kube-dns --namespace=kube-system
git clone https://github.com/coredns/deployment.git
./deployment/kubernetes/deploy.sh | kubectl apply -f -

By default, a standard storage class is available after cluster creation, using standard hard disks. For other storage types, you'll need to create specific storage classes.

About GKE storage classes

For more information and details on the available storage types in GKE, please refer to the "GCE PD" section of the Kubernetes documentation and the "Persistent volumes with Persistent Disks" page and related ones in the official documentation for Google Cloud.