Skip to content

Commit

Permalink
Merge pull request #6692 from wind0r/update_vpc_cni
Browse files Browse the repository at this point in the history
Update vpc-cni to 1.12.6
  • Loading branch information
Himangini authored Jun 16, 2023
2 parents e265ede + 33d80e4 commit d2d9faf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 37 deletions.
57 changes: 25 additions & 32 deletions pkg/addons/default/assets/aws-node.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
---
# Source: aws-vpc-cni/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: aws-node
namespace: kube-system
labels:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.11.3"
---
# Source: aws-vpc-cni/templates/customresourcedefinition.yaml
# Source: crds/customresourcedefinition.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: eniconfigs.crd.k8s.amazonaws.com
labels:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.11.3"
spec:
scope: Cluster
group: crd.k8s.amazonaws.com
Expand All @@ -37,6 +20,19 @@ spec:
plural: eniconfigs
singular: eniconfig
kind: ENIConfig

---
# Source: aws-vpc-cni/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: aws-node
namespace: kube-system
labels:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.12.6"
---
# Source: aws-vpc-cni/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -47,7 +43,7 @@ metadata:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.11.3"
app.kubernetes.io/version: "v1.12.6"
rules:
- apiGroups:
- crd.k8s.amazonaws.com
Expand All @@ -73,7 +69,7 @@ rules:
- apiGroups: ["", "events.k8s.io"]
resources:
- events
verbs: ["create", "patch", "list", "get"]
verbs: ["create", "patch", "list"]
---
# Source: aws-vpc-cni/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -84,7 +80,7 @@ metadata:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.11.3"
app.kubernetes.io/version: "v1.12.6"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -104,7 +100,7 @@ metadata:
app.kubernetes.io/name: aws-node
app.kubernetes.io/instance: aws-vpc-cni
k8s-app: aws-node
app.kubernetes.io/version: "v1.11.3"
app.kubernetes.io/version: "v1.12.6"
spec:
updateStrategy:
rollingUpdate:
Expand All @@ -125,7 +121,7 @@ spec:
hostNetwork: true
initContainers:
- name: aws-vpc-cni-init
image: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.11.3"
image: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.12.6"
env:
- name: DISABLE_TCP_EARLY_DEMUX
value: "false"
Expand All @@ -143,7 +139,7 @@ spec:
{}
containers:
- name: aws-node
image: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.11.3"
image: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.12.6"
ports:
- containerPort: 61678
name: metrics
Expand Down Expand Up @@ -172,8 +168,6 @@ spec:
value: "true"
- name: AWS_VPC_ENI_MTU
value: "9001"
- name: AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER
value: "false"
- name: AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG
value: "false"
- name: AWS_VPC_K8S_CNI_EXTERNALSNAT
Expand Down Expand Up @@ -212,23 +206,25 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
resources:
requests:
cpu: 25m
securityContext:
capabilities:
add:
- NET_ADMIN
allowPrivilegeEscalation: false
- NET_RAW
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
- mountPath: /host/var/log/aws-routed-eni
name: log-dir
- mountPath: /var/run/dockershim.sock
name: dockershim
- mountPath: /var/run/aws-node
name: run-dir
- mountPath: /run/xtables.lock
Expand All @@ -240,9 +236,6 @@ spec:
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d
- name: dockershim
hostPath:
path: /var/run/dockershim.sock
- name: log-dir
hostPath:
path: /var/log/aws-routed-eni
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/aws_node_generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package defaultaddons

// Please refer to https://docs.aws.amazon.com/eks/latest/userguide/cni-upgrades.html
//go:generate curl --silent --location https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/v1.11.3/config/master/aws-k8s-cni.yaml?raw=1 --output assets/aws-node.yaml
//go:generate curl --silent --location https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/v1.12.6/config/master/aws-k8s-cni.yaml?raw=1 --output assets/aws-node.yaml
8 changes: 4 additions & 4 deletions pkg/addons/default/aws_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ var _ = Describe("AWS Node", func() {
Expect(err).NotTo(HaveOccurred())
Expect(awsNode.Spec.Template.Spec.Containers).To(HaveLen(1))
Expect(awsNode.Spec.Template.Spec.Containers[0].Image).To(
Equal("602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon-k8s-cni:v1.11.3"),
Equal("602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon-k8s-cni:v1.12.6"),
)
Expect(awsNode.Spec.Template.Spec.InitContainers).To(HaveLen(1))
Expect(awsNode.Spec.Template.Spec.InitContainers[0].Image).To(
Equal("602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon-k8s-cni-init:v1.11.3"),
Equal("602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon-k8s-cni-init:v1.12.6"),
)
})
})
Expand All @@ -98,11 +98,11 @@ var _ = Describe("AWS Node", func() {
Expect(err).NotTo(HaveOccurred())
Expect(awsNode.Spec.Template.Spec.Containers).To(HaveLen(1))
Expect(awsNode.Spec.Template.Spec.Containers[0].Image).To(
Equal("961992271922.dkr.ecr.cn-northwest-1.amazonaws.com.cn/amazon-k8s-cni:v1.11.3"),
Equal("961992271922.dkr.ecr.cn-northwest-1.amazonaws.com.cn/amazon-k8s-cni:v1.12.6"),
)
Expect(awsNode.Spec.Template.Spec.InitContainers).To(HaveLen(1))
Expect(awsNode.Spec.Template.Spec.InitContainers[0].Image).To(
Equal("961992271922.dkr.ecr.cn-northwest-1.amazonaws.com.cn/amazon-k8s-cni-init:v1.11.3"),
Equal("961992271922.dkr.ecr.cn-northwest-1.amazonaws.com.cn/amazon-k8s-cni-init:v1.12.6"),
)
})
})
Expand Down

0 comments on commit d2d9faf

Please sign in to comment.