---
title: Charmhub | Deploy Charmed PostgreSQL K8s using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of Charmed PostgreSQL K8s as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/postgresql-k8s/actions
---

# Charmed PostgreSQL K8s

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")
* [Databases](https://charmhub.io/?filter=databases)

Platform:

14/stable 960

```
juju deploy postgresql-k8s --channel 14/stable --trust
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

* [create-backup](https://charmhub.io/postgresql-k8s/actions#create-backup)
* [create-replication](https://charmhub.io/postgresql-k8s/actions#create-replication)
* [get-password](https://charmhub.io/postgresql-k8s/actions#get-password)
* [get-primary](https://charmhub.io/postgresql-k8s/actions#get-primary)
* [list-backups](https://charmhub.io/postgresql-k8s/actions#list-backups)
* [pre-upgrade-check](https://charmhub.io/postgresql-k8s/actions#pre-upgrade-check)
* [promote-to-primary](https://charmhub.io/postgresql-k8s/actions#promote-to-primary)
* [restore](https://charmhub.io/postgresql-k8s/actions#restore)
* [resume-upgrade](https://charmhub.io/postgresql-k8s/actions#resume-upgrade)
* [set-password](https://charmhub.io/postgresql-k8s/actions#set-password)
* [set-tls-private-key](https://charmhub.io/postgresql-k8s/actions#set-tls-private-key)

[Learn about actions >](https://juju.is/docs/juju/action)

* create-backup

  Creates a backup to s3 storage in AWS.

  Params

  + type
    string

    The backup type, the default value is 'full'. Full backup is a full copy of all data. Differential backup is a copy only of changed data since the last full backup. Incremental backup is a copy only of changed data since the last backup (any type). Possible values - full, differential, incremental.
* create-replication

  Set up asynchronous replication between two clusters.

  Params

  + name
    string

    The name of the replication (defaults to 'default').
* get-password

  Get a charm system user's password. Useful for manual troubleshooting and for backing up cluster credentials. It cannot be used for application integration relations.

  Params

  + username
    string

    The username, the default value 'operator'. Possible values - backup, operator, replication, rewind, patroni.
* get-primary

  Get the unit with is the primary/leader in the replication.
* list-backups

  Lists backups in s3 storage in AWS.
* pre-upgrade-check

  Run necessary pre-upgrade checks and preparations before executing a charm refresh.
* promote-to-primary

  Promotes the cluster of choice to a primary cluster. Must be ran against the leader unit when promoting a cluster or against the unit to be promoted within the cluster.

  Params

  + force
    boolean

    Force the promotion of a cluster when there is already a primary cluster.
  + scope
    string

    Whether to promote a unit or a cluster. Must be set to either unit or cluster.
* restore

  Restore a database backup using pgBackRest. S3 credentials are retrieved from a relation with the S3 integrator charm.

  Params

  + backup-id
    string

    A backup-id to identify the backup to restore (format = %Y-%m-%dT%H:%M:%SZ)
  + restore-to-time
    string

    Point-in-time-recovery target in PSQL format.
* resume-upgrade

  Resume a rolling upgrade after asserting successful upgrade of a new revision.
* set-password

  Change the system user's password, which is used by charm. It is for internal charm users and SHOULD NOT be used by applications.

  Params

  + password
    string

    The password will be auto-generated if this option is not specified.
  + username
    string

    The username, the default value 'operator'. Possible values - backup, operator, replication rewind.
* set-tls-private-key

  Set the private key, which will be used for certificate signing requests (CSR). Run for each unit separately.

  Params

  + private-key
    string

    The content of private key for communications with clients. Content will be auto-generated if this option is not specified.
