Skip to content
Announcing BigAnimal: Fully managed PostgreSQL in the Cloud
Get startedContact usCareersDocsPlans

Introducing: The Cloud Native PostgreSQL Plugin for kubectl

Jonathan Battiato3/3/2021
Product updates

At EDB, we released Cloud Native PostgreSQL 1.1.0 at the beginning of February. As a DevOps team, we continuously improve our software by incrementally introducing new features. In this way, we increase velocity and provide our customers with a working tool that will be improved and enriched on each further release (currently every two weeks).

One of the most useful features we have recently introduced is the CNP plugin for the kubectl tool. In this post, we will provide an overview of the enhancements this plugin brings to our users.

 

About the plugin

Based on our customers’ feedback, we designed a tool that expands our operator capabilities to ease the management of a Cloud Native PostgreSQL (CNP) cluster on Kubernetes from a user perspective.

One of the most important capabilities is the ability to show the status of a CNP cluster through the status subcommand, which will show a list of the cluster’s nodes and their conditions at any time.

The promote command has been introduced in the CNP plugin at the beginning of its implementation. In the next release, two more subcommands will be added: status and certificate.

 

How to install it

Installation is managed by a shell script that can be found here.

Make sure you have curl installed on your machine, then run the following command:

curl -sSfL \

  https://github.com/EnterpriseDB/kubectl-cnp/raw/main/install.sh | \

  sudo sh -s -- -b /usr/local/bin

 

Available subcommands

Below we share a brief overview of each subcommand. Since each subcommand deserves separate analysis, we will show them in detail in the next blog posts, so make sure to keep up to date with our blog.

status

This command shows a PostgreSQL cluster’s status in Kubernetes, showing the instance’s health and potential ongoing operations.

Usage:

kubectl cnp status [cluster] [flags]

promote

This command promotes the specified server as a primary, performing a switchover procedure in a given CNP cluster.

Usage:

kubectl cnp promote [cluster] [server] [flags]

 

certificate

This command creates a new Kubernetes secret containing the crypto-material needed to configure TLS with Certificate authentication access for an application to connect to the PostgreSQL cluster.

Usage:

kubectl cnp certificate [secretName] [flags]

 

Conclusions

CNP plugin for kubectl is becoming a Swiss Army knife tool for administrators to manage a Cloud Native PostgreSQL cluster inside Kubernetes. We expect to implement even more features based on users’ feedback.

For more information, we recommend staying tuned for the upcoming blog posts, where subcommands will be analyzed in detail.
 

Jonathan Battiato is a CKA, Linux SysAdmin at EDB. His core areas of expertise include Kubernetes administration, Linux administration, PostgreSQL backup, and replication architecture. Prior to working at EDB, Jonathan worked as an Linux Administrator, PostgreSQL consultant, PostgreSQL and Linux tea ...