Skip to content

Commit 955f361

Browse files
author
CloudNativePG Automated Updates
committed
chore: sync API
1 parent 3a30780 commit 955f361

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

pkg/api/v1/cluster_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ type ClusterSpec struct {
330330
// +optional
331331
ServiceAccountTemplate *ServiceAccountTemplate `json:"serviceAccountTemplate,omitempty"`
332332

333+
// Name of an existing ServiceAccount in the same namespace to use for the cluster.
334+
// When specified, the operator will not create a new ServiceAccount
335+
// but will use the provided one. This is useful for sharing a single
336+
// ServiceAccount across multiple clusters (e.g., for cloud IAM configurations).
337+
// If not specified, a ServiceAccount will be created with the cluster name.
338+
// Mutually exclusive with ServiceAccountTemplate.
339+
// +optional
340+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serviceAccountName is immutable"
341+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
342+
// +kubebuilder:validation:MaxLength=253
343+
ServiceAccountName string `json:"serviceAccountName,omitempty"`
344+
333345
// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
334346
// +optional
335347
WalStorage *StorageConfiguration `json:"walStorage,omitempty"`

pkg/api/v1/pooler_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ type PoolerSpec struct {
9797
// Template for the Service to be created
9898
// +optional
9999
ServiceTemplate *ServiceTemplateSpec `json:"serviceTemplate,omitempty"`
100+
101+
// Name of an existing ServiceAccount in the same namespace to use for the pooler.
102+
// When specified, the operator will not create a new ServiceAccount
103+
// but will use the provided one. This is useful for sharing a single
104+
// ServiceAccount across multiple poolers (e.g., for cloud IAM configurations).
105+
// If not specified, a ServiceAccount will be created with the pooler name.
106+
// +optional
107+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serviceAccountName is immutable"
108+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
109+
// +kubebuilder:validation:MaxLength=253
110+
ServiceAccountName string `json:"serviceAccountName,omitempty"`
100111
}
101112

102113
// PoolerMonitoringConfiguration is the type containing all the monitoring

0 commit comments

Comments
 (0)