CSPL-3064: Support for Distroless Image Creation in Splunk Operator for Kubernetes #1421
+370
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for creating a distroless image for the Splunk Operator for Kubernetes alongside the existing UBI (Universal Base Image) image. Instead of replacing the UBI image, we will provide both UBI and distroless images to allow flexibility for different customer requirements. This enhancement improves security by reducing the attack surface of the operator container while maintaining compatibility with existing workflows.
Why This Change Is Needed
Currently, the Splunk Operator uses the UBI image, which includes a complete Linux environment with various tools and libraries that may not be necessary for running the operator. By supporting a distroless image, we can:
Changes Implemented
Makefile Update:
distroless
base image is being used.docker-buildx
target to support building both UBI and distroless images.-distroless
suffix (<image-name>-distroless
).Dockerfile Update:
Dockerfile
to support building a distroless image.Dockerfile.distroless
with only essential dependencies required for runtime.CI/CD Pipeline:
Documentation:
Benefits
Impact
Tasks Completed
Dockerfile
and created a newDockerfile.distroless
.Makefile
to build both UBI and distroless images.Next Steps
How to Test
Build the UBI Image:
Build the Distroless Image:
Run Integration Tests:
Priority: High
This change enhances the security posture of the Splunk Operator and aligns with best practices for container image minimalism.
Reviewer Notes:
Please review the changes to the Dockerfile, Makefile, and CI/CD pipeline. Special attention should be given to the sidecar proposal for customer debugging.