### Start Local Development Server Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/README.md Starts a local development server for live preview. Changes are reflected without server restart. ```shell $ yarn start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/README.md Installs project dependencies using Yarn. Run this command from the top directory. ```shell $ yarn ``` -------------------------------- ### Example Plugin Status Output Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.7.0/troubleshooting.md This is an example output from `kubectl cnpg status`, showing the registration details of the barman-cloud plugin. ```text Plugins status Name Version Status Reported Operator Capabilities ---- ------- ------ ------------------------------ barman-cloud.cloudnative-pg.io 0.6.0 N/A Reconciler Hooks, Lifecycle Service ``` -------------------------------- ### Example Tenant Resource for MinIO Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.13.0/object_stores.md This is an example of a MinIO Tenant resource configuration. It shows the basic structure and metadata required to deploy a MinIO tenant. ```yaml apiVersion: minio.min.io/v2 kind: Tenant metadata: name: cnpg-backups spec: [...] ``` -------------------------------- ### Install Cert-Manager Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md If cert-manager is not installed, use this command to install it. This is a prerequisite for automatic certificate management used by the plugin. ```sh # Note: other installation methods for cert-manager are available kubectl apply -f \ https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml ``` -------------------------------- ### Check Plugin Installation Certificates Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/troubleshooting.md Verify if cert-manager is installed and running, and check if the plugin's certificate has been created. If cert-manager is not installed, this command shows how to install it. ```sh # Check if cert-manager is installed and running kubectl get pods -n cert-manager ``` ```sh # Check if the plugin certificate is created kubectl get certificates -n cnpg-system ``` ```sh # Note: other installation methods for cert-manager are available kubectl apply -f \ https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml ``` -------------------------------- ### Install or Update cnpg kubectl Plugin Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Installs or updates the `cnpg` plugin for `kubectl` using `krew`. Ensure you have `krew` installed first. ```sh # Install or update the `cnpg` plugin kubectl krew install cnpg # Or using an alternative method: https://cloudnative-pg.io/documentation/current/kubectl-plugin/#install ``` -------------------------------- ### Original ScheduledBackup (In-Tree) Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/migration.md This is an example of a ScheduledBackup resource using the original in-tree backup implementation. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup metadata: name: pg-eu-backup spec: cluster: name: pg-eu schedule: '0 0 0 * * *' backupOwnerReference: self ``` -------------------------------- ### In-tree CloudNativePG Backup Configuration Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/migration.md Example of a traditional in-tree CloudNativePG backup configuration using barmanObjectStore. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: pg-eu spec: # [...] backup: barmanObjectStore: destinationPath: s3://backups/ endpointURL: http://minio-eu:9000 s3Credentials: accessKeyId: name: minio-eu key: ACCESS_KEY_ID secretAccessKey: name: minio-eu key: ACCESS_SECRET_KEY wal: compression: gzip ``` -------------------------------- ### Check Cert-Manager Installation Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.11.0/troubleshooting.md Verify if cert-manager is installed and running in your cluster. If not, install it using the provided command. ```sh # Check if cert-manager is installed and running kubectl get pods -n cert-manager ``` ```sh # Note: other installation methods for cert-manager are available kubectl apply -f \ https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml ``` -------------------------------- ### Install Latest Development Snapshot Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/installation.mdx Apply the manifest directly from the main branch to test the latest development snapshot of the Barman Cloud plugin. ```sh kubectl apply -f \ https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml ``` -------------------------------- ### Define ObjectStore Resource for MinIO Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/usage.md This example shows how to create an ObjectStore resource for a MinIO object store. It specifies the destination path, endpoint URL, S3 credentials, and WAL compression settings. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: minio-store spec: configuration: destinationPath: s3://backups/ endpointURL: http://minio:9000 s3Credentials: accessKeyId: name: minio key: ACCESS_KEY_ID secretAccessKey: name: minio key: ACCESS_SECRET_KEY wal: compression: gzip ``` -------------------------------- ### Configure S3-Compatible Object Store (DigitalOcean) Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/object_stores.md Configure DigitalOcean Spaces as an object store, specifying the endpoint URL and bucket path. This example uses path-style access. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: digitalocean-store spec: configuration: destinationPath: "s3://BUCKET_NAME/path/to/folder" endpointURL: "https://sfo3.digitaloceanspaces.com" s3Credentials: [...] [...] ``` -------------------------------- ### Configure Object Store with Linode Object Storage Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.6.0/object_stores.md Example of an ObjectStore resource configured for Linode (Akamai) Object Storage, specifying the destination path and endpoint URL. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: linode-store spec: configuration: destinationPath: "s3://BUCKET_NAME/" endpointURL: "https://us-east1.linodeobjects.com" s3Credentials: [...] [...] ``` -------------------------------- ### Configure Replica Cluster with Barman Cloud Plugin Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.12.0/usage.md Example of defining a replica cluster, specifying Barman Cloud Plugin configurations for WAL archiving and external clusters. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: cluster-dc-a spec: instances: 3 primaryUpdateStrategy: unsupervised storage: storageClass: csi-hostpath-sc size: 1Gi plugins: - name: barman-cloud.cloudnative-pg.io isWALArchiver: true parameters: barmanObjectName: minio-store-a replica: self: cluster-dc-a primary: cluster-dc-a source: cluster-dc-b externalClusters: - name: cluster-dc-a plugin: name: barman-cloud.cloudnative-pg.io parameters: barmanObjectName: minio-store-a - name: cluster-dc-b plugin: name: barman-cloud.cloudnative-pg.io parameters: barmanObjectName: minio-store-b ``` -------------------------------- ### List all backups and their status Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Use this command to get a list of all backups for a given namespace and check their current status. ```sh # List all backups and their status kubectl get backups.postgresql.cnpg.io -n ``` -------------------------------- ### Configure 30-Day Retention Policy Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/retention.md Example of setting a 30-day retention policy in the ObjectStore resource. This ensures backups older than 30 days are automatically cleaned up. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: my-store spec: [...] retentionPolicy: "30d" ``` -------------------------------- ### Check Plugin Certificate Creation Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Inspect Kubernetes certificates to ensure the plugin's required certificates have been successfully created. This is a common step in troubleshooting plugin installation issues. ```sh # Check if the plugin certificate is created kubectl get certificates -n cnpg-system ``` -------------------------------- ### Example ObjectStore Resource for Barman Cloud Plugin Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/migration.md This YAML defines an ObjectStore resource for the Barman Cloud plugin, translating the configuration from an in-tree backup. It includes the object store details under the 'configuration' field. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: minio-eu spec: configuration: destinationPath: s3://backups/ endpointURL: http://minio-eu:9000 s3Credentials: accessKeyId: name: minio-eu key: ACCESS_KEY_ID secretAccessKey: name: minio-eu key: ACCESS_SECRET_KEY wal: compression: gzip ``` -------------------------------- ### Configure Plugin Instance Sidecar Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/usage.md Example of configuring the Barman Cloud Plugin sidecar using an ObjectStore resource. This allows fine-tuning of backup, WAL archiving, and restore processes. ```yaml apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: minio-store spec: configuration: # [...] instanceSidecarConfiguration: retentionPolicyIntervalSeconds: 1800 resources: requests: memory: "XXX" cpu: "YYY" limits: memory: "XXX" cpu: "YYY" ``` -------------------------------- ### Describe Rolebindings to Verify Role Name References Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/resource-name-migration.md Inspect rolebindings to ensure they reference the correct, updated role names after the migration. ```bash kubectl describe rolebinding barman-plugin-leader-election-rolebinding -n cnpg-system ``` ```bash kubectl describe clusterrolebinding barman-plugin-metrics-auth-rolebinding ``` -------------------------------- ### Migrate from In-Tree Backups to Plugin-Based Backups Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/usage.md Illustrates the command syntax change when migrating from the older in-tree backup system to the new plugin-based backup system using `kubectl cnpg`. ```bash # Old command (in-tree backup) kubectl cnpg backup -n --method=barmanObjectStore # New command (plugin-based backup) kubectl cnpg backup -n \ --method=plugin \ --plugin-name=barman-cloud.cloudnative-pg.io ``` -------------------------------- ### Check Cert-Manager Installation Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Verify if cert-manager is installed and running in your cluster. This is crucial for certificate management, especially for plugin components. ```sh # Check if cert-manager is installed and running kubectl get pods -n cert-manager ``` -------------------------------- ### Check Plugin Certificate Status Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.13.0/troubleshooting.md Verify if cert-manager is installed and running, and check if the plugin's certificate has been created. This is crucial for resolving certificate-related installation issues. ```sh # Check if cert-manager is installed and running kubectl get pods -n cert-manager ``` ```sh # Check if the plugin certificate is created kubectl get certificates -n cnpg-system ``` -------------------------------- ### Install Barman Cloud Plugin Manifest Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.12.0/installation.mdx Apply the Kubernetes manifest to install the Barman Cloud plugin. This command creates necessary Custom Resource Definitions, Service Accounts, Roles, ClusterRoles, RoleBindings, ClusterRoleBindings, Secrets, Services, Deployments, Certificates, and Issuers. ```sh kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/v0.12.0/manifest.yaml ``` -------------------------------- ### Create a Declarative Backup Resource Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/usage.md Apply a Backup resource manifest to create a backup. Ensure the cluster and plugin configuration are correctly specified. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Backup metadata: name: backup-example spec: cluster: name: cluster-example method: plugin pluginConfiguration: name: barman-cloud.cloudnative-pg.io ``` -------------------------------- ### Check cert-manager API Availability Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/installation.mdx Confirm that cert-manager is installed and its API is accessible using the cmctl tool. ```sh cmctl check api ``` -------------------------------- ### List and Describe Backups Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.13.0/troubleshooting.md Commands to list all backups and retrieve detailed information about a specific backup, including error messages and the target instance. ```sh # List all backups and their status kubectl get backups.postgresql.cnpg.io -n ``` ```sh # Get detailed backup information including error messages and target instance kubectl describe backups.postgresql.cnpg.io \ -n ``` -------------------------------- ### Verify CloudNativePG Version Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/installation.mdx Check the installed CloudNativePG version using kubectl. The version must be 1.26 or newer. ```sh kubectl get deployment -n cnpg-system cnpg-controller-manager \ -o jsonpath="{.spec.template.spec.containers[*].image}" ``` -------------------------------- ### Migrate Backup Command Syntax Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/usage.md Compare the old in-tree backup command syntax with the new plugin-based backup command syntax for migration purposes. ```bash # Old command (in-tree backup) kubectl cnpg backup -n --method=barmanObjectStore # New command (plugin-based backup) kubectl cnpg backup -n \ --method=plugin \ --plugin-name=barman-cloud.cloudnative-pg.io ``` -------------------------------- ### Get Backup Details and Target Pod Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Retrieve detailed information about a specific backup and identify the pod it is associated with. ```bash kubectl describe backups.postgresql.cnpg.io \ -n ``` ```bash kubectl get backups.postgresql.cnpg.io \ -n \ -o jsonpath='{.status.instanceID.podName}' ``` -------------------------------- ### Get detailed backup information Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Retrieve detailed information about a specific backup, including error messages and the target instance it was performed on. ```sh # Get detailed backup information including error messages and target instance kubectl describe backups.postgresql.cnpg.io \ -n ``` -------------------------------- ### Check Plugin Deployment Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/troubleshooting.md Verify that the Barman Cloud plugin deployment exists in the `cnpg-system` namespace. ```bash kubectl get deployment -n cnpg-system barman-cloud ``` -------------------------------- ### Restore Cluster from Object Store Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/usage.md Configure a new Cluster resource to restore from a backup in an object store. This example does not enable WAL archiving. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: cluster-restore spec: instances: 3 imagePullPolicy: IfNotPresent bootstrap: recovery: source: source externalClusters: - name: source plugin: name: barman-cloud.cloudnative-pg.io parameters: barmanObjectName: minio-store serverName: cluster-example storage: size: 1Gi ``` -------------------------------- ### Example In-Tree CloudNativePG Backup Configuration Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/versioned_docs/version-0.10.0/migration.md This YAML shows a traditional in-tree backup configuration within a CloudNativePG Cluster resource. It specifies the object store destination, endpoint, credentials, and WAL compression. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: pg-eu spec: # [...] backup: barmanObjectStore: destinationPath: s3://backups/ endpointURL: http://minio-eu:9000 s3Credentials: accessKeyId: name: minio-eu key: ACCESS_KEY_ID secretAccessKey: name: minio-eu key: ACCESS_SECRET_KEY wal: compression: gzip ``` -------------------------------- ### Install Barman Cloud Plugin Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/installation.mdx Apply the latest release manifest for the Barman Cloud plugin using kubectl. This command creates necessary Kubernetes resources. ```sh kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/manifests/plugin-barman-cloud.yaml ``` -------------------------------- ### Create a Declarative Backup Resource Source: https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/web/docs/usage.md Apply a YAML manifest to create a Backup resource for plugin-based backups. Ensure WAL archiving is already configured. ```yaml apiVersion: postgresql.cnpg.io/v1 kind: Backup metadata: name: backup-example spec: cluster: name: cluster-example method: plugin pluginConfiguration: name: barman-cloud.cloudnative-pg.io ```