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

feat: add init containers #1423

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kimxogus
Copy link

Add init containers to each deployment components

Signed-off-by: Taehyun Kim <kgyoo8232@gmail.com>
@zyyw
Copy link
Collaborator

zyyw commented Mar 9, 2023

@kimxogus could you please justify why we need this init containers?

@kimxogus
Copy link
Author

kimxogus commented Mar 9, 2023

@zyyw As harbor-registry component doesn't check if the pod has proper iam permission(not like https://github.com/distribution/distribution), I'd like to prevent pod from running if pod doesn't have proper iam permission.

As I have to use kiam or kube2iam to use harbor-registry, there could be mistakes like assigning wrong node groups which don't have permission to assume kiam/kube2iam role.

@rwd5213
Copy link

rwd5213 commented Jan 31, 2024

Hi, we actually need this for Trivy init container. when in offline environments we need an init container that downloads the vulnerability data base to the trivy container

@Vad1mo
Copy link
Member

Vad1mo commented Jan 31, 2024

IMO, Trivy can download the DB itself? Why are you using the init container?

@rwd5213
Copy link

rwd5213 commented Feb 2, 2024

Because of environment where it cannot download the database from the open internet, we use an init container to pull the database from S3 for example. I am not aware of a way to directly tell Trivy where to download the data base from. Basically to automate this https://aquasecurity.github.io/trivy/v0.49/docs/advanced/air-gap/

Copy link

github-actions bot commented Apr 3, 2024

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Apr 3, 2024
@Vad1mo
Copy link
Member

Vad1mo commented Apr 3, 2024

I don't find this to be a bad idea, there are a many uses cases that I can think of that would simplify the user of harbor with an init container.

@kimxogus @rwd5213 can you rebase and resolve the conflicts, I would like to get those changes in.

@Vad1mo Vad1mo removed the Stale label Apr 3, 2024
@Vad1mo Vad1mo self-requested a review April 3, 2024 19:55
@rwd5213
Copy link

rwd5213 commented Apr 3, 2024

@kimxogus I realized this is missing the init container in the in the https://github.com/goharbor/harbor-helm/blob/main/templates/trivy/trivy-sts.yaml, any chance you can add it there as well?

@kimxogus
Copy link
Author

kimxogus commented Apr 4, 2024

Merged current main and also applied to trivy statefulset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants