File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -141,14 +141,18 @@ other roles.
141141
142142To define the secrets for the users in a different namespace than that of the
143143cluster, one can set ` enable_cross_namespace_secret ` and declare the namespace
144- for the secrets in the manifest in the following manner,
144+ for the secrets in the manifest in the following manner (note, that it has to
145+ be reflected in the ` database ` section, too),
145146
146147``` yaml
147148spec :
148149 users :
149- # users with secret in dfferent namespace
150- appspace.db_user :
150+ # users with secret in different namespace
151+ appspace.db_user :
151152 - createdb
153+ databases :
154+ # namespace notation is part of user name
155+ app_db : appspace.db_user
152156` ` `
153157
154158Here, anything before the first dot is considered the namespace and the text after
@@ -554,7 +558,8 @@ schema creation. This means they are currently not set when `defaultUsers`
554558For all LOGIN roles the operator will create K8s secrets in the namespace
555559specified in `secretNamespace`, if `enable_cross_namespace_secret` is set to
556560` true` in the config. Otherwise, they are created in the same namespace like
557- the Postgres cluster.
561+ the Postgres cluster. Unlike roles specified with `namespace.username` under
562+ ` users` , the namespace will not be part of the role name here.
558563
559564` ` ` yaml
560565spec:
Original file line number Diff line number Diff line change @@ -1176,6 +1176,7 @@ func (c *Cluster) initRobotUsers() error {
11761176 if strings .Contains (username , "." ) {
11771177 splits := strings .Split (username , "." )
11781178 namespace = splits [0 ]
1179+ c .logger .Warningf ("enable_cross_namespace_secret is set. Database role name contains the respective namespace i.e. %s is the created user" , username )
11791180 }
11801181 }
11811182
You can’t perform that action at this time.
0 commit comments