Skip to content

Commit

Permalink
consul-connect-inject-init needs to run privileged: true when tproxy …
Browse files Browse the repository at this point in the history
…is enabled (#524)

On OpenShift, if we don't set this value, the container will not provisioned with proper
privileges to run iptabels commands
  • Loading branch information
ishustava authored May 25, 2021
1 parent 0bc1f55 commit 08cc8b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ IMPROVEMENTS:
transparent proxy is enabled. [[GH-517](https://github.com/hashicorp/consul-k8s/pull/517)]
* Connect: Don't set security context for the Envoy proxy when on OpenShift and transparent proxy is disabled.
[[GH-521](https://github.com/hashicorp/consul-k8s/pull/521)]
* Connect: `consul-connect-inject-init` run with `privileged: true` when transparent proxy is enabled.
[[GH-524](https://github.com/hashicorp/consul-k8s/pull/524)]

BUG FIXES:
* Connect: Process every Address in an Endpoints object before returning an error. This ensures an address that isn't reconciled successfully doesn't prevent the remaining addresses from getting reconciled. [[GH-519](https://github.com/hashicorp/consul-k8s/pull/519)]
Expand Down
1 change: 1 addition & 0 deletions connect-inject/container_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (h *Handler) containerInit(namespace corev1.Namespace, pod corev1.Pod) (cor
RunAsGroup: pointerToInt64(rootUserAndGroupID),
// RunAsNonRoot overrides any setting in the Pod so that we can still run as root here as required.
RunAsNonRoot: pointerToBool(false),
Privileged: pointerToBool(true),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{netAdminCapability},
},
Expand Down
1 change: 1 addition & 0 deletions connect-inject/container_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ func TestHandlerContainerInit_transparentProxy(t *testing.T) {
expectedSecurityContext := &corev1.SecurityContext{
RunAsUser: pointerToInt64(0),
RunAsGroup: pointerToInt64(0),
Privileged: pointerToBool(true),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{netAdminCapability},
},
Expand Down

0 comments on commit 08cc8b6

Please sign in to comment.