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

Add an init program to vertica-k8s image #320

Merged
merged 5 commits into from
Jan 19, 2023
Merged

Conversation

spilchen
Copy link
Collaborator

This adds a proper init program to the vertica-k8s container so that it can reap zombie process and automatically restart cron/sshd if they fail. We use s6-overlay as our init program. It adds about 7MB (uncompressed) to our images.

There were a few additional items included in this due to that change:

  • Removed the /config directory setup that was in the container entry script. This is better suited for the operator when it runs the install reconciler. We already did some setup in the operator, this just moves all of the pieces that were previously in the container.
  • Related to the above, we set the securityPolicy.fsGroup so that the PV that is mounted in the container uses the gid of dbadmin. This gives it write access to the PV and no chmod was needed for the PVs in the container.
  • Cleanup of the pod_facts.go. We kept track of certain files and directories with individual bools. This is managed in a much better way through a map.
  • Removed some hacks that were added for 11.0.0 related to directory permissions of /opt/vertica/config/logrotate. The new minimum version the operator supports is now 11.0.1.

@spilchen spilchen self-assigned this Jan 17, 2023
Copy link
Collaborator

@roypaulin roypaulin left a comment

Choose a reason for hiding this comment

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

Looks Good ! Just have a comment.

paths.ConfigLogrotatePath,
paths.ConfigSharePath,
paths.HTTPTLSConfDir, paths.HTTPTLSConfFile,
paths.ConfigLogrotatePath, paths.ConfigLogrotatePath,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is each argument passed twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We test each file like this:

echo -n '  %s: '
test -f %s && echo true || echo false

We want the file name to be displayed, then the actual test for the file after it. So, we need to reference the same variable twice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah Ok, did not see it was fmt.Sprintf

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