Skip to content
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

Run scrutinize in its own pod #706

Merged
merged 5 commits into from
Feb 20, 2024
Merged

Run scrutinize in its own pod #706

merged 5 commits into from
Feb 20, 2024

Conversation

roypaulin
Copy link
Collaborator

@roypaulin roypaulin commented Feb 15, 2024

When a VerticaScrutinize resource is created, the operator:

  • collects some info from the specified VerticaDB in order to construct vcluster scrutinize command arguments
  • builds the scrutinize podspec. That pod will shares the same serviceaccount, podsecuritycontext, image as vertica pods.
  • adds some env vars to the podspec needed by nma and also 2 new env vars(PASSWORD_NAMESPACE, PASSWORD_NAME) to allow vcluster scrutinize to read the db password from secret.

Once the pod is created, a new reconciler(PodPollingReconciler) will wait for scrutinize to finish and update status condition

@roypaulin
Copy link
Collaborator Author

I am not sure about using the same serviceaccount and podsecuritycontext on verticapods and scrutinize pod. Were you planning for scrutinize to have its own?

Copy link
Collaborator

@spilchen spilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I deployed the new CR on my machine and it was able to run scrutinize just fine. It's pretty slick.

pkg/builder/builder.go Outdated Show resolved Hide resolved
pkg/builder/builder.go Outdated Show resolved Hide resolved
pkg/builder/builder.go Show resolved Hide resolved
pkg/builder/builder.go Outdated Show resolved Hide resolved
pkg/controllers/vscr/podpolling_reconciler.go Outdated Show resolved Hide resolved
pkg/controllers/vscr/podpolling_reconciler.go Show resolved Hide resolved
pkg/builder/builder.go Show resolved Hide resolved
pkg/builder/builder.go Outdated Show resolved Hide resolved
pkg/controllers/vscr/podpolling_reconciler.go Outdated Show resolved Hide resolved
@roypaulin roypaulin self-assigned this Feb 15, 2024
Copy link
Collaborator

@spilchen spilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I had a few minor suggestions but approving as I trust they will be applied.

if vinf.IsOlder(v1.ScrutinizeDBPasswdInSecretMinVersion) {
ver, _ := s.Vdb.GetVerticaVersionStr()
s.VRec.Eventf(s.Vscr, corev1.EventTypeWarning, events.VclusterOpsScrutinizePasswdInSecretNotSupported,
"The server version %s does not support vclusterOps scrutinize reading db password from secret", ver)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we shorten this to say it only runs with 24.2.0?

Suggested change
"The server version %s does not support vclusterOps scrutinize reading db password from secret", ver)
"The server version %s is not supported with VerticaScrutinize. The minimum server version it supports is %s.", ver, v1.ScrutinizeDBPasswdInSecretMinVersion)


if vinf.IsOlder(v1.ScrutinizeDBPasswdInSecretMinVersion) {
ver, _ := s.Vdb.GetVerticaVersionStr()
s.VRec.Eventf(s.Vscr, corev1.EventTypeWarning, events.VclusterOpsScrutinizePasswdInSecretNotSupported,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we reuse the event. It all means the same thing, we don't support the deployment.

Suggested change
s.VRec.Eventf(s.Vscr, corev1.EventTypeWarning, events.VclusterOpsScrutinizePasswdInSecretNotSupported,
s.VRec.Eventf(s.Vscr, corev1.EventTypeWarning, events.VclusterOpsScrutinizeNotSupported,

@roypaulin roypaulin merged commit e25a090 into vnext Feb 20, 2024
30 checks passed
@roypaulin roypaulin deleted the roypaulin/scrutinize-pod branch February 20, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants