Skip to content

Commit

Permalink
Merge pull request #8541 from hakman/automated-cherry-pick-of-#8538-u…
Browse files Browse the repository at this point in the history
…pstream-release-1.16

Automated cherry pick of #8538: Update amazon-vpc-cni-k8s to v1.6.0
  • Loading branch information
k8s-ci-robot committed Feb 14, 2020
2 parents feb2bf9 + 6c55218 commit a6868da
Show file tree
Hide file tree
Showing 9 changed files with 376 additions and 11 deletions.
3 changes: 1 addition & 2 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2220,8 +2220,7 @@ spec:
VPC CNI networking
properties:
imageName:
description: 'The container image name to use, which by default
is: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.5'
description: The container image name to use
type: string
type: object
calico:
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ type RomanaNetworkingSpec struct {

// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// The container image name to use, which by default is:
// 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.5
// The container image name to use
ImageName string `json:"imageName,omitempty"`
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/kops/v1alpha1/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ type RomanaNetworkingSpec struct {

// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// The container image name to use, which by default is:
// 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.5
// The container image name to use
ImageName string `json:"imageName,omitempty"`
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ type RomanaNetworkingSpec struct {

// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// The container image name to use, which by default is:
// 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.5
// The container image name to use
ImageName string `json:"imageName,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Vendored from https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/v1.6/aws-k8s-cni.yaml

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aws-node
rules:
- apiGroups:
- crd.k8s.amazonaws.com
resources:
- "*"
- namespaces
verbs:
- "*"
- apiGroups: [""]
resources:
- pods
- nodes
- namespaces
verbs: ["list", "watch", "get"]
- apiGroups: ["extensions"]
resources:
- daemonsets
verbs: ["list", "watch"]

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: aws-node
namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: aws-node
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aws-node
subjects:
- kind: ServiceAccount
name: aws-node
namespace: kube-system

---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: aws-node
namespace: kube-system
labels:
k8s-app: aws-node
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: "10%"
selector:
matchLabels:
k8s-app: aws-node
template:
metadata:
labels:
k8s-app: aws-node
spec:
priorityClassName: system-node-critical
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "beta.kubernetes.io/os"
operator: In
values:
- linux
- key: "beta.kubernetes.io/arch"
operator: In
values:
- amd64
- key: eks.amazonaws.com/compute-type
operator: NotIn
values:
- fargate
serviceAccountName: aws-node
hostNetwork: true
tolerations:
- operator: Exists
containers:
- image: "{{- or .Networking.AmazonVPC.ImageName "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.6.0" }}"
imagePullPolicy: Always
ports:
- containerPort: 61678
name: metrics
name: aws-node
readinessProbe:
exec:
command: ["/app/grpc-health-probe", "-addr=:50051"]
initialDelaySeconds: 35
livenessProbe:
exec:
command: ["/app/grpc-health-probe", "-addr=:50051"]
initialDelaySeconds: 35
env:
- name: CLUSTER_NAME
value: {{ ClusterName }}
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: DEBUG
- name: AWS_VPC_K8S_CNI_VETHPREFIX
value: eni
- name: AWS_VPC_ENI_MTU
value: "9001"
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
requests:
cpu: 10m
securityContext:
privileged: true
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
- mountPath: /host/var/log
name: log-dir
- mountPath: /var/run/docker.sock
name: dockersock
- mountPath: /var/run/dockershim.sock
name: dockershim
volumes:
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d
- name: log-dir
hostPath:
path: /var/log
- name: dockersock
hostPath:
path: /var/run/docker.sock
- name: dockershim
hostPath:
path: /var/run/dockershim.sock

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: eniconfigs.crd.k8s.amazonaws.com
spec:
scope: Cluster
group: crd.k8s.amazonaws.com
versions:
- name: v1alpha1
served: true
storage: true
names:
plural: eniconfigs
singular: eniconfig
kind: ENIConfig
17 changes: 16 additions & 1 deletion upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
"k8s-1.8": "1.5.0-kops.1",
"k8s-1.10": "1.5.0-kops.2",
"k8s-1.12": "1.5.5-kops.1",
"k8s-1.16": "1.6.0-kops.1",
}

{
Expand Down Expand Up @@ -1109,7 +1110,21 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
Version: fi.String(versions[id]),
Selector: networkingSelector,
Manifest: fi.String(location),
KubernetesVersion: ">=1.12.0",
KubernetesVersion: ">=1.12.0 <1.16.0",
Id: id,
})
}

{
id := "k8s-1.16"
location := key + "/" + id + ".yaml"

addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{
Name: fi.String(key),
Version: fi.String(versions[id]),
Selector: networkingSelector,
Manifest: fi.String(location),
KubernetesVersion: ">=1.16.0",
Id: id,
})
}
Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/bootstrapchannelbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestBootstrapChannelBuilder_BuildTasks(t *testing.T) {
// Use cilium networking, proxy
runChannelBuilderTest(t, "cilium", []string{"dns-controller.addons.k8s.io-k8s-1.12", "kops-controller.addons.k8s.io-k8s-1.16"})
runChannelBuilderTest(t, "weave", []string{})
runChannelBuilderTest(t, "amazonvpc", []string{"networking.amazon-vpc-routed-eni-k8s-1.12"})
runChannelBuilderTest(t, "amazonvpc", []string{"networking.amazon-vpc-routed-eni-k8s-1.12", "networking.amazon-vpc-routed-eni-k8s-1.16"})
}

func runChannelBuilderTest(t *testing.T, key string, addonManifests []string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,18 @@ spec:
role.kubernetes.io/networking: "1"
version: 1.5.0-kops.2
- id: k8s-1.12
kubernetesVersion: '>=1.12.0'
kubernetesVersion: '>=1.12.0 <1.16.0'
manifest: networking.amazon-vpc-routed-eni/k8s-1.12.yaml
manifestHash: 7b91bf39d562157bd45b6a29e5f58d817c6ea4e1
name: networking.amazon-vpc-routed-eni
selector:
role.kubernetes.io/networking: "1"
version: 1.5.5-kops.1
- id: k8s-1.16
kubernetesVersion: '>=1.16.0'
manifest: networking.amazon-vpc-routed-eni/k8s-1.16.yaml
manifestHash: ff9687c4431781c50257b44a9610765e52d0f137
name: networking.amazon-vpc-routed-eni
selector:
role.kubernetes.io/networking: "1"
version: 1.6.0-kops.1
Loading

0 comments on commit a6868da

Please sign in to comment.