Skip to content

Feature request: Read CronJob secrets from different namespace than the cluster's #3067

@mreiche

Description

@mreiche

The CronJobEnvironmentSecretVariables are being read from the cluster namespace by default: https://github.com/zalando/postgres-operator/blob/master/pkg/cluster/k8sres.go#L1205

Should it be possible to define a namespace override for this secret, to prevent secret duplication if multiple clusters to multiple namespace haven been deployed?

Proposal:

type LogicalBackup struct {
	LogicalBackupCronjobEnvironmentSecret     string `name:"logical_backup_cronjob_environment_secret" default:""`
	LogicalBackupCronjobEnvironmentSecretNamespace     string `name:"logical_backup_cronjob_environment_secret_namespace" default:""`
}
func (c *Cluster) getCronjobEnvironmentSecretVariables() ([]v1.EnvVar, error) {
// [..]
	var secretNamespace string

	if c.OpConfig.LogicalBackupCronjobEnvironmentSecretNamespace == "" {
		secretNamespace = c.OpConfig.LogicalBackupCronjobEnvironmentSecretNamespace
	} else {
		secretNamespace = c.Namespace
	}
	
	secret, err := c.KubeClient.Secrets(secretNamespace).Get(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions