File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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"`
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments