Skip to content

Commit 647bb13

Browse files
authored
Merge pull request #8510 from zalando-incubator/eks-custom-networking
eks: Optional support for AWS VPC CNI Custom Networking
2 parents 85cd55a + b33a886 commit 647bb13

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

cluster/config-defaults.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,10 @@ eks_fis_namespaces: "default"
12721272

12731273
# prefix delegation can only be configured for ipv4. For ipv6 it can only be true.
12741274
aws_vpc_cni_prefix_delegation: "false"
1275+
# enable custom networking for the AWS VPC CNI. This assumes that a custom CIDR
1276+
# range is available in the VPC and that there are dedicated subnets for the
1277+
# custom CIDR.
1278+
aws_vpc_cni_custom_networking: "false"
12751279
# enable network policy enforcement in the cluster.
12761280
aws_vpc_cni_enable_network_policy: "false"
12771281
# specify the network policy enforcement mode.

cluster/manifests/01-aws-node/daemonset.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ spec:
5555
- name: AWS_VPC_ENI_MTU
5656
value: "9001"
5757
- name: AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG
58-
value: "false"
58+
value: "{{ .Cluster.ConfigItems.aws_vpc_cni_custom_networking }}"
59+
# {{ if eq .Cluster.ConfigItems.aws_vpc_cni_custom_networking "true" }}
60+
- name: ENI_CONFIG_LABEL_DEF
61+
value: topology.kubernetes.io/zone
62+
# {{ end }}
5963
- name: AWS_VPC_K8S_CNI_EXTERNALSNAT
6064
value: "false"
6165
- name: AWS_VPC_K8S_CNI_LOGLEVEL
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# {{ if eq .Cluster.Provider "zalando-eks" }}
2+
# {{ if eq .Cluster.ConfigItems.aws_vpc_cni_custom_networking "true" }}
3+
# {{ with $data := . }}
4+
# {{ with $azCount := len $data.Values.availability_zones }}
5+
# {{ range $az := $data.Values.availability_zones }}
6+
# {{ with $azID := azID $az }}
7+
---
8+
apiVersion : crd.k8s.amazonaws.com/v1alpha1
9+
kind : ENIConfig
10+
metadata:
11+
name: "{{$az}}"
12+
labels:
13+
application: kubernetes
14+
component: aws-node
15+
spec:
16+
securityGroups:
17+
- {{ $data.Values.ClusterStackOutputs.EKSWorkerSecurityGroup }}
18+
subnet: "{{ index $data.Values.pod_subnets $az }}"
19+
# {{end}}
20+
# {{end}}
21+
# {{end}}
22+
# {{end}}
23+
# {{end}}
24+
# {{end}}

cluster/manifests/deletions.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ post_apply:
415415
kind: ServiceAccount
416416
namespace: kube-system
417417
{{- end}}
418+
{{- if eq .Cluster.Provider "zalando-eks"}}
419+
{{- if ne .Cluster.ConfigItems.aws_vpc_cni_custom_networking "true"}}
420+
- kind: ENIConfig
421+
labels:
422+
application: kubernetes
423+
component: aws-node
424+
{{- end }}
425+
{{- end }}
418426
{{- if ne .Cluster.ConfigItems.emergency_access_service_enabled "true" }}
419427
- name: emergency-access-service
420428
kind: Deployment

0 commit comments

Comments
 (0)