Skip to content

Commit

Permalink
request NET_RAW capabilities in CNI manifests (#2063)
Browse files Browse the repository at this point in the history
* request NET_RAW capabilities in CNI manifests

* add request NET_RAW capabilities in chart and jsonnet

* update format
  • Loading branch information
JingmingGuo authored Oct 25, 2022
1 parent 7eeb2a9 commit 9bee3e4
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The following table lists the configurable parameters for this chart and their d
| `podLabels` | Labels to add to each pod | `{}` |
| `priorityClassName` | Name of the priorityClass | `system-node-critical` |
| `resources` | Resources for the pods | `requests.cpu: 10m` |
| `securityContext` | Container Security context | `capabilities: add: - "NET_ADMIN"` |
| `securityContext` | Container Security context | `capabilities: add: - "NET_ADMIN" - "NET_RAW"` |
| `serviceAccount.name` | The name of the ServiceAccount to use | `nil` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.annotations` | Specifies the annotations for ServiceAccount | `{}` |
Expand Down
1 change: 1 addition & 0 deletions charts/aws-vpc-cni/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ securityContext:
capabilities:
add:
- "NET_ADMIN"
- "NET_RAW"

crd:
create: true
Expand Down
1 change: 1 addition & 0 deletions charts/aws-vpc-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ securityContext:
capabilities:
add:
- "NET_ADMIN"
- "NET_RAW"

crd:
create: true
Expand Down
1 change: 1 addition & 0 deletions config/master/aws-k8s-cni-cn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ spec:
capabilities:
add:
- NET_ADMIN
- NET_RAW
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
Expand Down
1 change: 1 addition & 0 deletions config/master/aws-k8s-cni-us-gov-east-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ spec:
capabilities:
add:
- NET_ADMIN
- NET_RAW
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
Expand Down
1 change: 1 addition & 0 deletions config/master/aws-k8s-cni-us-gov-west-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ spec:
capabilities:
add:
- NET_ADMIN
- NET_RAW
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
Expand Down
1 change: 1 addition & 0 deletions config/master/aws-k8s-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ spec:
capabilities:
add:
- NET_ADMIN
- NET_RAW
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
Expand Down
2 changes: 1 addition & 1 deletion config/master/manifests.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ local awsnode = {
requests: {cpu: "25m"},
},
securityContext: {
capabilities: {add: ["NET_ADMIN"]},
capabilities: {add: ["NET_ADMIN", "NET_RAW"]},
},
volumeMounts: [
{mountPath: "/host/opt/cni/bin", name: "cni-bin-dir"},
Expand Down
1 change: 1 addition & 0 deletions test/e2e/snat/snat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func ValidateIPTableRules(randomizedSNATValue string, numOfCidrs int) {
Command([]string{"./snat-utils"}).
CapabilitiesForSecurityContext([]corev1.Capability{
"NET_ADMIN",
"NET_RAW",
}, nil).
Args(testerArgs).
Build()
Expand Down

0 comments on commit 9bee3e4

Please sign in to comment.