switchover
) or in-place (restart
externalClusters
-ExternalClusterList
+[]ExternalCluster
The list of external clusters which are used in the configuration
@@ -2706,19 +2706,89 @@ storage
-## ExternalClusterList {#postgresql-cnpg-io-v1-ExternalClusterList}
+## ExternalCluster {#postgresql-cnpg-io-v1-ExternalCluster}
-(Alias of `[]github.com/cloudnative-pg/cloudnative-pg/api/v1.ExternalCluster`)
**Appears in:**
- [ClusterSpec](#postgresql-cnpg-io-v1-ClusterSpec)
-ExternalClusterList is a list of external clusters
-
+ExternalCluster represents the connection parameters to an
+external cluster which is used in the other sections of the configuration
+
+Field Description
+
+name
[Required]
+string
+
+
+ The server name, required
+
+
+connectionParameters
+map[string]string
+
+
+ The list of connection parameters, such as dbname, host, username, etc
+
+
+sslCert
+core/v1.SecretKeySelector
+
+
+ The reference to an SSL certificate to be used to connect to this
+instance
+
+
+sslKey
+core/v1.SecretKeySelector
+
+
+ The reference to an SSL private key to be used to connect to this
+instance
+
+
+sslRootCert
+core/v1.SecretKeySelector
+
+
+ The reference to an SSL CA public key to be used to connect to this
+instance
+
+
+password
+core/v1.SecretKeySelector
+
+
+ The reference to the password to be used to connect to the server.
+If a password is provided, CloudNativePG creates a PostgreSQL
+passfile at /controller/external/NAME/pass
(where "NAME" is the
+cluster's name). This passfile is automatically referenced in the
+connection string when establishing a connection to the remote
+PostgreSQL server from the current PostgreSQL Cluster
. This ensures
+secure and efficient password management for external clusters.
+
+
+barmanObjectStore
+github.com/cloudnative-pg/barman-cloud/pkg/api.BarmanObjectStoreConfiguration
+
+
+ The configuration for the barman-cloud tool suite
+
+
+plugin
[Required]
+PluginConfiguration
+
+
+ The configuration of the plugin that is taking care
+of WAL archiving and backups for this external cluster
+
+
+
+
## ImageCatalogRef {#postgresql-cnpg-io-v1-ImageCatalogRef}
@@ -3616,6 +3686,7 @@ the operator calls PgBouncer's PAUSE
and RESUME
comman
**Appears in:**
+- [ExternalCluster](#postgresql-cnpg-io-v1-ExternalCluster)
PluginConfiguration specifies a plugin that need to be loaded for this
diff --git a/internal/cmd/manager/walrestore/cmd.go b/internal/cmd/manager/walrestore/cmd.go
index 4accc2a023..8b1835a271 100644
--- a/internal/cmd/manager/walrestore/cmd.go
+++ b/internal/cmd/manager/walrestore/cmd.go
@@ -262,7 +262,10 @@ func restoreWALViaPlugins(
availablePluginNamesSet := stringset.From(availablePluginNames)
enabledPluginNames := cluster.Spec.Plugins.GetEnabledPluginNames()
- enabledPluginNames = append(enabledPluginNames, cluster.Spec.ExternalClusters.GetEnabledPluginNames()...)
+ enabledPluginNames = append(
+ enabledPluginNames,
+ apiv1.GetExternalClustersEnabledPluginNames(cluster.Spec.ExternalClusters)...,
+ )
enabledPluginNamesSet := stringset.From(enabledPluginNames)
client, err := pluginClient.WithPlugins(
diff --git a/internal/controller/cluster_controller.go b/internal/controller/cluster_controller.go
index 6194505985..958f98f1bd 100644
--- a/internal/controller/cluster_controller.go
+++ b/internal/controller/cluster_controller.go
@@ -176,7 +176,10 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
// Load the plugins required to bootstrap and reconcile this cluster
enabledPluginNames := cluster.Spec.Plugins.GetEnabledPluginNames()
- enabledPluginNames = append(enabledPluginNames, cluster.Spec.ExternalClusters.GetEnabledPluginNames()...)
+ enabledPluginNames = append(
+ enabledPluginNames,
+ apiv1.GetExternalClustersEnabledPluginNames(cluster.Spec.ExternalClusters)...,
+ )
pluginLoadingContext, cancelPluginLoading := context.WithTimeout(ctx, 5*time.Second)
defer cancelPluginLoading()
diff --git a/internal/management/controller/subscription_controller_test.go b/internal/management/controller/subscription_controller_test.go
index f6afdc0c4e..f699324805 100644
--- a/internal/management/controller/subscription_controller_test.go
+++ b/internal/management/controller/subscription_controller_test.go
@@ -69,8 +69,8 @@ var _ = Describe("Managed subscription controller tests", func() {
TargetPrimary: "cluster-example-1",
},
Spec: apiv1.ClusterSpec{
- ExternalClusters: apiv1.ExternalClusterList{
- apiv1.ExternalCluster{
+ ExternalClusters: []apiv1.ExternalCluster{
+ {
Name: "cluster-other",
ConnectionParameters: map[string]string{
"host": "localhost",