Skip to content

Commit 1ab3eca

Browse files
committed
Use IPv6-enabled proxy-init
Followup to linkerd/linkerd2-proxy-init#350 In support of the new proxy-init flags `--iptables-mode` and `--ipv6`: - For the linkerd-control-plane chart added the values.yaml entry `enableIPv6` (defaults to true). The `proxyInit.iptablesMode` was already there, but we interpret it now slightly differently in `_proxy-init.tpl`. - For the linkerd2-cni chart added the entries `iptablesMode` (defaults to "legacy") and `enableIPv6` (defaults to true). Note this allows routing IPv6 traffic to the proxy, but it's just the first step towards IPv6/dual-stack support. More control plane and proxy changes will come up next. *Do not merge yet*: We're pulling the images `ghcr.io/alpeb/proxy-init:ipv6` and `ghcr.io/alpeb/cni-plugin:ipv6` as temporary builds for linkerd/linkerd2-proxy-init#350, while that gets released.
1 parent cb21f1b commit 1ab3eca

File tree

69 files changed

+365
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+365
-147
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ permissions:
2929
env:
3030
CARGO_INCREMENTAL: 0
3131
CARGO_NET_RETRY: 10
32-
DOCKER_REGISTRY: ghcr.io/linkerd
32+
DOCKER_REGISTRY: ghcr.io/alpeb
3333
GH_ANNOTATION: true
3434
K3D_VERSION: v5.4.4
3535
RUST_BACKTRACE: short

charts/linkerd-control-plane/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ Kubernetes: `>=1.22.0-0`
161161
| disableHeartBeat | bool | `false` | Set to true to not start the heartbeat cronjob |
162162
| enableEndpointSlices | bool | `true` | enables the use of EndpointSlice informers for the destination service; enableEndpointSlices should be set to true only if EndpointSlice K8s feature gate is on |
163163
| enableH2Upgrade | bool | `true` | Allow proxies to perform transparent HTTP/2 upgrading |
164+
| enableIPv6 | bool | `true` | enables routing IPv6 traffic in addition to IPv4 traffic through the proxy |
164165
| enablePSP | bool | `false` | Add a PSP resource and bind it to the control plane ServiceAccounts. Note PSP has been deprecated since k8s v1.21 |
165166
| enablePodAntiAffinity | bool | `false` | enables pod anti affinity creation on deployments for high availability |
166167
| enablePodDisruptionBudget | bool | `false` | enables the creation of pod disruption budgets for control plane components |
@@ -269,9 +270,9 @@ Kubernetes: `>=1.22.0-0`
269270
| proxyInit.closeWaitTimeoutSecs | int | `0` | |
270271
| proxyInit.ignoreInboundPorts | string | `"4567,4568"` | Default set of inbound ports to skip via iptables - Galera (4567,4568) |
271272
| proxyInit.ignoreOutboundPorts | string | `"4567,4568"` | Default set of outbound ports to skip via iptables - Galera (4567,4568) |
272-
| proxyInit.image.name | string | `"cr.l5d.io/linkerd/proxy-init"` | Docker image for the proxy-init container |
273+
| proxyInit.image.name | string | `"ghcr.io/alpeb/proxy-init"` | Docker image for the proxy-init container |
273274
| proxyInit.image.pullPolicy | string | imagePullPolicy | Pull policy for the proxy-init container image |
274-
| proxyInit.image.version | string | `"v2.2.4"` | Tag for the proxy-init container image |
275+
| proxyInit.image.version | string | `"ipv6"` | Tag for the proxy-init container image |
275276
| proxyInit.iptablesMode | string | `"legacy"` | Variant of iptables that will be used to configure routing. Currently, proxy-init can be run either in 'nft' or in 'legacy' mode. The mode will control which utility binary will be called. The host must support whichever mode will be used |
276277
| proxyInit.kubeAPIServerPorts | string | `"443,6443"` | Default set of ports to skip via iptables for control plane components so they can communicate with the Kubernetes API Server |
277278
| proxyInit.logFormat | string | plain | Log format (`plain` or `json`) for the proxy-init |

charts/linkerd-control-plane/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ deploymentStrategy:
3232
# enableEndpointSlices should be set to true only if EndpointSlice K8s feature
3333
# gate is on
3434
enableEndpointSlices: true
35+
# -- enables routing IPv6 traffic in addition to IPv4 traffic through the proxy
36+
enableIPv6: true
3537
# -- enables pod anti affinity creation on deployments for high availability
3638
enablePodAntiAffinity: false
3739
# -- enables the use of pprof endpoints on control plane component's admin
@@ -264,7 +266,7 @@ proxyInit:
264266
# @default -- imagePullPolicy
265267
pullPolicy: ""
266268
# -- Tag for the proxy-init container image
267-
version: v2.2.4
269+
version: ipv6
268270
resources:
269271
cpu:
270272
# -- Maximum amount of CPU units that the proxy-init container can use

charts/linkerd2-cni/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ Kubernetes: `>=1.22.0-0`
2525
| commonLabels | object | `{}` | Labels to apply to all resources |
2626
| destCNIBinDir | string | `"/opt/cni/bin"` | Directory on the host where the CNI configuration will be placed |
2727
| destCNINetDir | string | `"/etc/cni/net.d"` | Directory on the host where the CNI plugin binaries reside |
28+
| enableIPv6 | bool | `true` | Enables adding IPv6 rules on top of IPv4 rules |
2829
| enablePSP | bool | `false` | Add a PSP resource and bind it to the linkerd-cni ServiceAccounts. Note PSP has been deprecated since k8s v1.21 |
2930
| extraInitContainers | list | `[]` | Add additional initContainers to the daemonset |
3031
| ignoreInboundPorts | string | `""` | Default set of inbound ports to skip via iptables |
3132
| ignoreOutboundPorts | string | `""` | Default set of outbound ports to skip via iptables |
32-
| image.name | string | `"cr.l5d.io/linkerd/cni-plugin"` | Docker image for the CNI plugin |
33+
| image.name | string | `"ghcr.io/alpeb/cni-plugin"` | Docker image for the CNI plugin |
3334
| image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the linkerd-cni container |
34-
| image.version | string | `"v1.3.0"` | Tag for the CNI container Docker image |
35+
| image.version | string | `"ipv6"` | Tag for the CNI container Docker image |
3536
| imagePullSecrets | list | `[]` | |
3637
| inboundProxyPort | int | `4143` | Inbound port for the proxy container |
38+
| iptablesMode | string | `"legacy"` | Variant of iptables that will be used to configure routing |
3739
| logLevel | string | `"info"` | Log level for the CNI plugin |
3840
| outboundProxyPort | int | `4140` | Outbound port for the proxy container |
3941
| podLabels | object | `{}` | Additional labels to add to all pods |

charts/linkerd2-cni/templates/cni-plugin.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ data:
176176
],
177177
{{- end }}
178178
"simulate": false,
179-
"use-wait-flag": {{.Values.useWaitFlag}}
179+
"use-wait-flag": {{.Values.useWaitFlag}},
180+
"iptables-mode": {{.Values.iptablesMode | quote}},
181+
"ipv6": {{.Values.enableIPv6}}
180182
}
181183
}
182184
---

charts/linkerd2-cni/values.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ destCNINetDir: "/etc/cni/net.d"
2626
destCNIBinDir: "/opt/cni/bin"
2727
# -- Configures the CNI plugin to use the -w flag for the iptables command
2828
useWaitFlag: false
29+
# -- Variant of iptables that will be used to configure routing
30+
iptablesMode: "legacy"
31+
# -- Enables adding IPv6 rules on top of IPv4 rules
32+
enableIPv6: true
2933
# -- Kubernetes priorityClassName for the CNI plugin's Pods
3034
priorityClassName: ""
3135

@@ -51,9 +55,9 @@ tolerations:
5155
# -|- Image section
5256
image:
5357
# -- Docker image for the CNI plugin
54-
name: "cr.l5d.io/linkerd/cni-plugin"
58+
name: "ghcr.io/alpeb/cni-plugin"
5559
# -- Tag for the CNI container Docker image
56-
version: "v1.3.0"
60+
version: "ipv6"
5761
# -- Pull policy for the linkerd-cni container
5862
pullPolicy: IfNotPresent
5963

charts/partials/templates/_proxy-init.tpl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{{- define "partials.proxy-init" -}}
2-
args:
3-
{{- if (.Values.proxyInit.iptablesMode | default "legacy" | eq "nft") }}
4-
- --firewall-bin-path
5-
- "iptables-nft"
6-
- --firewall-save-bin-path
7-
- "iptables-nft-save"
8-
{{- else if not (eq .Values.proxyInit.iptablesMode "legacy") }}
2+
{{ if not (has .Values.proxyInit.iptablesMode (list "nft" "legacy")) -}}
93
{{ fail (printf "Unsupported value \"%s\" for proxyInit.iptablesMode\nValid values: [\"nft\", \"legacy\"]" .Values.proxyInit.iptablesMode) }}
4+
{{end -}}
5+
args:
6+
- --iptables-mode={{.Values.proxyInit.iptablesMode}}
7+
{{- if .Values.enableIPv6 }}
8+
- --ipv6
109
{{- end }}
1110
- --incoming-proxy-port
1211
- {{.Values.proxy.ports.inbound | quote}}

cli/cmd/testdata/inject-filepath/expected/injected_nginx.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ spec:
171171
name: http
172172
initContainers:
173173
- args:
174+
- --iptables-mode=legacy
175+
- --ipv6
174176
- --incoming-proxy-port
175177
- "4143"
176178
- --outgoing-proxy-port
@@ -181,7 +183,7 @@ spec:
181183
- 4190,4191,4567,4568
182184
- --outbound-ports-to-ignore
183185
- 4567,4568
184-
image: cr.l5d.io/linkerd/proxy-init:v2.2.4
186+
image: ghcr.io/alpeb/proxy-init:ipv6
185187
imagePullPolicy: IfNotPresent
186188
name: linkerd-init
187189
resources:

cli/cmd/testdata/inject-filepath/expected/injected_nginx_redis.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ spec:
171171
name: server
172172
initContainers:
173173
- args:
174+
- --iptables-mode=legacy
175+
- --ipv6
174176
- --incoming-proxy-port
175177
- "4143"
176178
- --outgoing-proxy-port
@@ -181,7 +183,7 @@ spec:
181183
- 4190,4191,4567,4568
182184
- --outbound-ports-to-ignore
183185
- 4567,4568
184-
image: cr.l5d.io/linkerd/proxy-init:v2.2.4
186+
image: ghcr.io/alpeb/proxy-init:ipv6
185187
imagePullPolicy: IfNotPresent
186188
name: linkerd-init
187189
resources:
@@ -394,6 +396,8 @@ spec:
394396
name: http
395397
initContainers:
396398
- args:
399+
- --iptables-mode=legacy
400+
- --ipv6
397401
- --incoming-proxy-port
398402
- "4143"
399403
- --outgoing-proxy-port
@@ -404,7 +408,7 @@ spec:
404408
- 4190,4191,4567,4568
405409
- --outbound-ports-to-ignore
406410
- 4567,4568
407-
image: cr.l5d.io/linkerd/proxy-init:v2.2.4
411+
image: ghcr.io/alpeb/proxy-init:ipv6
408412
imagePullPolicy: IfNotPresent
409413
name: linkerd-init
410414
resources:

cli/cmd/testdata/inject-filepath/expected/injected_redis.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ spec:
171171
name: server
172172
initContainers:
173173
- args:
174+
- --iptables-mode=legacy
175+
- --ipv6
174176
- --incoming-proxy-port
175177
- "4143"
176178
- --outgoing-proxy-port
@@ -181,7 +183,7 @@ spec:
181183
- 4190,4191,4567,4568
182184
- --outbound-ports-to-ignore
183185
- 4567,4568
184-
image: cr.l5d.io/linkerd/proxy-init:v2.2.4
186+
image: ghcr.io/alpeb/proxy-init:ipv6
185187
imagePullPolicy: IfNotPresent
186188
name: linkerd-init
187189
resources:

cli/cmd/testdata/inject_contour.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_deployment.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_deployment_access_log.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_deployment_automountServiceAccountToken_false.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_deployment_capabilities.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/inject_emojivoto_deployment_config_overrides.golden.yml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)