spring-cloud / spring-cloud-deployer-kubernetes

The Spring Cloud Deployer implementation for Kubernetes
Apache License 2.0
157 stars 98 forks source link

Add support for seccompProfile on pod security context and configuring container security context. #472

Closed onobc closed 2 years ago

onobc commented 2 years ago

@ilayaperumalg ~The motivating issue also calls out the need for container level securityContext.(allowPrivilegeEscalation|readOnlyRootFilesystem) support . However, I would prefer if we split that into another ticket (or at least an additional pull request) to keep the changes in this code proposal concise~

ℹ️ Initially I was going to break this into 2 separate pull requests but decided to combine them once I saw them both implemented.

Adds support for configuring the seccompProfile on the pod security context

Adds support for configuring the security context on the main container

Refactors KubernetesAppDeployerTests as follows:

Motivation: The KubernetesAppDeployerTests has grown quite large and it is a challenge for a newbie (me) to grok all of whats going on in there. I leveraged @Nested to group the pod and container security context tests. I really love the output that @Nested produces in IntelliJ as well (see below)

nested-test-output

Remaining items

ilayaperumalg commented 2 years ago

@bono007 Thank you for the contribution! Sure, we can have those other properties addressed via a separate ticket.

dturanski commented 2 years ago

LGTM; Merging.