-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PT-2248 - pt-k8s-debug-collector does not run pg_gather with K8SPG 2 #654
PT-2248 - pt-k8s-debug-collector does not run pg_gather with K8SPG 2 #654
Conversation
- Added check for K8SPG 2, so can run pg_gather for it - Added new allowed value for option --resource: -- pgv2 for K8SPG 2 -- auto to auto-detect custom resource - Option --resource has now default value "auto" - Updated documentation - Added test cases for new options
if cr.Spec.SecretName != "" { | ||
user, err = d.getDataFromSecret(cr.Spec.SecretName, "username", namespace) | ||
} else { | ||
user, err = d.getDataFromSecret(crName+"-pguser-cluster1", "user", namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the secret name depends on the cluster name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it should be something like
user, err = d.getDataFromSecret(crName+"-pguser-cluster1", "user", namespace) | |
user, err = d.getDataFromSecret(crName+"-pguser-"+crName, "user", namespace) |
?
if cr.Spec.SecretName != "" { | ||
pass, err = d.getDataFromSecret(cr.Spec.SecretName, "password", namespace) | ||
} else { | ||
pass, err = d.getDataFromSecret(crName+"-pguser-cluster1", "password", namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the secret name depends on the cluster name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this should be something like
pass, err = d.getDataFromSecret(crName+"-pguser-cluster1", "password", namespace) | |
pass, err = d.getDataFromSecret(crName+"-pguser-"+crName, "password", namespace) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but I want to mention that it's not guaranteed to have this user in cluster. if the end user configured spec.users
, operator doesn't create this user. but we plan to change this logic and have a default user. @nmarukovich am i right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also please confirm if currently this user name is created as:
<CLUSTER NAME>-<pguser of anything, specified in spec.users>-<CLUSTER NAME>
So for default configuration this is cluster1-pguser-cluster1 and could be, for example mysupercluster-mysuperuser-mysupercluster? Or other variations are also possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by default it's <CLUSTER NAME>-pguser-<CLUSTER NAME>
if an user is specified in spec.users
it'll be <CLUSTER NAME>-pguser-<USERNAME>
and please note that the secret name is customizable with spec.users[].secretName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, implemented! Please review the updated patch.
- Implemented custom user and secrets handling (in case when no default user exists).
- Merge branch '3.x' into PT-2248_pt-k8s-debug-collector_does_not_run_pg_gather_with_K8SPG2
Added check for K8SPG 2, so can run pg_gather for it
Added new allowed value for option --resource: -- pgv2 for K8SPG 2
-- auto to auto-detect custom resource
Option --resource has now default value "auto"
Updated documentation
Added test cases for new options
The contributed code is licensed under GPL v2.0
Contributor Licence Agreement (CLA) is signed
util/update-modules has been ran
Documention updated
Test suite update