pass infra role names to pooler pods
This commit is contained in:
parent
866a17f881
commit
4857694002
|
|
@ -320,6 +320,18 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
|
|||
}
|
||||
envVars = append(envVars, c.getConnectionPoolerEnvVars()...)
|
||||
|
||||
infraRolesList := make([]string, 0)
|
||||
for infraRoleName := range c.Config.InfrastructureRoles {
|
||||
infraRolesList = append(infraRolesList, infraRoleName)
|
||||
}
|
||||
|
||||
if len(infraRolesList) > 0 {
|
||||
envVars = append(envVars, v1.EnvVar{
|
||||
Name: "INFRASTRUCTURE_ROLES_LIST",
|
||||
Value: strings.Join(infraRolesList, ","),
|
||||
})
|
||||
}
|
||||
|
||||
poolerContainer := v1.Container{
|
||||
Name: connectionPoolerContainer,
|
||||
Image: effectiveDockerImage,
|
||||
|
|
|
|||
|
|
@ -8,11 +8,12 @@ postgres = host=$PGHOST port=$PGPORT auth_user=$PGUSER
|
|||
pool_mode = $CONNECTION_POOLER_MODE
|
||||
listen_port = $CONNECTION_POOLER_PORT
|
||||
listen_addr = *
|
||||
auth_type = md5
|
||||
auth_file = /etc/pgbouncer/auth_file.txt
|
||||
auth_dbname = postgres
|
||||
admin_users = $PGUSER
|
||||
stats_users = $INFRASTRUCTURE_ROLES
|
||||
auth_dbname = postgres
|
||||
auth_file = /etc/pgbouncer/auth_file.txt
|
||||
auth_query = SELECT * FROM $PGSCHEMA.user_lookup($1)
|
||||
auth_type = md5
|
||||
logfile = /var/log/pgbouncer/pgbouncer.log
|
||||
pidfile = /var/run/pgbouncer/pgbouncer.pid
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue