Skip to content

Commit

Permalink
Remove Pgpool pcp service
Browse files Browse the repository at this point in the history
Signed-off-by: MobarakHsn <[email protected]>
  • Loading branch information
MobarakHsn committed May 31, 2024
1 parent 063e5bd commit e26fa91
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ const (
PgpoolContainerName = "pgpool"
PgpoolDefaultServicePort = 9999
PgpoolMonitoringDefaultServicePort = 9719
PgpoolPcpServicePort = 9595
PgpoolPcpPort = 9595
PgpoolExporterDatabase = "postgres"
EnvPgpoolExporterDatabase = "POSTGRES_DATABASE"
EnvPgpoolService = "PGPOOL_SERVICE"
Expand All @@ -597,7 +597,7 @@ const (
PgpoolRootUser = "postgres"
PgpoolPrimaryServicePortName = "primary"
PgpoolDatabasePortName = "db"
PgpoolPcpServicePortName = "pcp"
PgpoolPcpPortName = "pcp"
PgpoolCustomConfigFile = "pgpool.conf"
// ========================================== ZooKeeper Constants =================================================//

Expand Down
4 changes: 0 additions & 4 deletions apis/kubedb/v1alpha2/pgpool_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ func (p *Pgpool) ServiceName() string {
return p.OffshootName()
}

func (p *Pgpool) PcpServiceName() string {
return meta_util.NameWithSuffix(p.ServiceName(), "pcp")
}

// Owner returns owner reference to resources
func (p *Pgpool) Owner() *meta.OwnerReference {
return meta.NewControllerRef(p, SchemeGroupVersion.WithKind(p.ResourceKind()))
Expand Down
1 change: 0 additions & 1 deletion apis/kubedb/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const (
PrimaryServiceAlias ServiceAlias = "primary"
StandbyServiceAlias ServiceAlias = "standby"
StatsServiceAlias ServiceAlias = "stats"
PcpServiceAlias ServiceAlias = "pcp"
)

// +kubebuilder:validation:Enum=DNS;IP;IPv4;IPv6
Expand Down
14 changes: 9 additions & 5 deletions apis/ops/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions apis/ops/v1alpha1/pgpool_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,25 @@ type PgpoolVerticalScalingSpec struct {
Node *PodResources `json:"node,omitempty"`
}

// PgpoolCustomConfigurationSpec is the spec for Reconfiguring the Pgpool Settings
type PgpoolCustomConfigurationSpec struct {
ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"`
ApplyConfig map[string]string `json:"applyConfig,omitempty"`
RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"`
// ConfigSecret is an optional field to provide custom configuration file for Pgpool.
// +optional
ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"`
// ApplyConfig is an optional field to provide Pgpool configuration.
// Provided configuration will be applied to config files stored in ConfigSecret.
// If the ConfigSecret is missing, the operator will create a new k8s secret by the
// following naming convention: {db-name}-config or use the previous init config if it exists.
// Expected input format:
// applyConfig:
// pgpool.conf: |-
// memory_cache_enabled = off
// +optional
ApplyConfig map[string]string `json:"applyConfig,omitempty"`
// If set to "true", the user provided configuration via custom config and init config will be removed.
// Then Pgpool will start with default configuration that is generated by the operator.
// +optional
RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down

0 comments on commit e26fa91

Please sign in to comment.