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

[Feature]: Helper to inject postgres socket directory #10

Open
2 tasks done
ringerc opened this issue Jun 25, 2024 · 0 comments
Open
2 tasks done

[Feature]: Helper to inject postgres socket directory #10

ringerc opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ringerc
Copy link
Contributor

ringerc commented Jun 25, 2024

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

Since many plugins that inject sidecars into postgres pods will want to communicate with postgres, a helper for injecting the pg socket volume mount would be useful.

Describe the solution you'd like

A helper method that finds the scratch-data Volume in the target Pod and injects a VolumeMount for it into a specified Container, expected to be a sidecar managed by the plugin. It should accept the path at which the socket directory should be mounted.

The VolumeMount should specify a SubMount of run so only the postgres socket directory gets mounted.

Something like

        corev1.VolumeMount{
            {
                Name:      "scratch-data",
                ReadOnly:  false,
                MountPath: "/var/run/postgresql",
                // postgres socket dir is in /run/run on the cnp pod
                SubPath:   config.PgSocketSubVolumeName,
	   }

While this is trivial to implement in a plugin, the helper will know the correct socket volume name scratch-data which is not exposed in CNPG as a constant anywhere. It's also going to be common enough it just makes sense to add.

Describe alternatives you've considered

I just added it in my plugin code, it's trivial, but seems like something common enough to be worth doing in a helper.

Additional context

No response

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ringerc ringerc added the enhancement New feature or request label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants