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

Unable to address the helm chart issues reported by the static code analysis #1031

Open
alita1991 opened this issue Jan 13, 2025 · 6 comments

Comments

@alita1991
Copy link

Hi,

Today, I decided to scan the verticadb-operator helm chart for any possible issue with kube-score and kube-linter and got the following issues:

[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) The container is running with a low user ID
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) The container running with a low group ID
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) ImagePullPolicy is not set to Always
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: The pod does not have a matching NetworkPolicy
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) Ephemeral Storage limit is not set
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) Ephemeral Storage request is not set

From what I investigated so far, the securityContext (pod + container) is not exposed currently, and I'm unable to configure those via configuration.

Is there any plan to expose the important fields for each resource?

Thank you

@qindotguan
Copy link
Collaborator

We do support Vertica server container securityContext in the spec. Can you try the configurations below?

spec:
  ...
  securityContext:
    privileged: true

And also the pod-level security context:

spec:
  ...
  podSecurityContext:
    runAsUser: 3500
    runAsGroup: 3500
  ...

For more details, you can search securityContext in this page:
https://docs.vertica.com/24.4.x/en/containerized/custom-resource-definition-parameters/

@roypaulin
Copy link
Collaborator

[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) The container is running with a low user ID
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) The container running with a low group ID

This scan does not take the container(Dockerfile) into account. The base image is gcr.io/distroless/static:nonroot, which does not include a root user. The container will use a default non-root user with UID and GID set to 65532. See docker-operator/Dockerfile

@roypaulin
Copy link
Collaborator

roypaulin commented Jan 14, 2025

[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) ImagePullPolicy is not set to Always

This is more like a choice to not pull the image each time.

@roypaulin
Copy link
Collaborator

roypaulin commented Jan 14, 2025

[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) Ephemeral Storage limit is not set
[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: (manager) Ephemeral Storage request is not set

Yes, it is a good practice to set ephemeral storage for Kubernetes operator pods. We did not because the operator doesn't rely on local disk storage, it only reconciles states.

@roypaulin
Copy link
Collaborator

[CRITICAL] verticadb-operator-manager/default apps/v1/Deployment: The pod does not have a matching NetworkPolicy

We don't necessarily need one because the operator does not need to communicate with other pods and is in an isolated environment.

@alita1991
Copy link
Author

We do support Vertica server container securityContext in the spec. Can you try the configurations below?

spec:
  ...
  securityContext:
    privileged: true

And also the pod-level security context:

spec:
  ...
  podSecurityContext:
    runAsUser: 3500
    runAsGroup: 3500
  ...

For more details, you can search securityContext in this page: https://docs.vertica.com/24.4.x/en/containerized/custom-resource-definition-parameters/

Is there any plan to expose the securityContext and podSecurityContext for the operator as well?

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

No branches or pull requests

3 participants