Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use containerd.sock for AmazonVPC CNI with containerd #10502

Merged
merged 1 commit into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion upup/models/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"path": "/etc/cni/net.d"
"name": "cni-net-dir"
- "hostPath":
"path": "/var/run/dockershim.sock"
"path": "{{ if eq .ContainerRuntime "containerd" }}/run/containerd/containerd.sock{{ else }}/var/run/dockershim.sock{{ end }}"
"name": "dockershim"
- "hostPath":
"path": "/run/xtables.lock"
Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann

versions := map[string]string{
"k8s-1.12": "1.5.5-kops.1",
"k8s-1.16": "1.7.5-kops.1",
"k8s-1.16": "1.7.8-kops.1",
}

{
Expand Down
1 change: 1 addition & 0 deletions upup/pkg/fi/cloudup/bootstrapchannelbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func TestBootstrapChannelBuilder_BuildTasks(t *testing.T) {
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", "networking.amazon-vpc-routed-eni-k8s-1.16"})
runChannelBuilderTest(t, "amazonvpc-containerd", []string{"networking.amazon-vpc-routed-eni-k8s-1.12", "networking.amazon-vpc-routed-eni-k8s-1.16"})
runChannelBuilderTest(t, "awsiamauthenticator", []string{"authentication.aws-k8s-1.12"})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
addons:
- manifest: s3://somebucket/example.yaml
kubernetesApiAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
containerRuntime: containerd
etcdClusters:
- etcdMembers:
- instanceGroup: master-us-test-1a
name: master-us-test-1a
name: main
- etcdMembers:
- instanceGroup: master-us-test-1a
name: master-us-test-1a
name: events
iam: {}
kubernetesVersion: v1.16.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
additionalSans:
- proxy.api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
amazonvpc:
env:
- name: WARM_IP_TARGET
value: "10"
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: debug
nonMasqueradeCIDR: 100.64.0.0/10
sshAccess:
- 0.0.0.0/0
topology:
masters: public
nodes: public
subnets:
- cidr: 172.20.32.0/19
name: us-test-1a
type: Public
zone: us-test-1a
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
kind: Addons
metadata:
creationTimestamp: null
name: bootstrap
spec:
addons:
- id: k8s-1.16
kubernetesVersion: '>=1.16.0-alpha.0'
manifest: kops-controller.addons.k8s.io/k8s-1.16.yaml
manifestHash: 5b7765907ec5720081c13c0cab2d32b99053e7c8
name: kops-controller.addons.k8s.io
selector:
k8s-addon: kops-controller.addons.k8s.io
version: 1.19.0-beta.2
- manifest: core.addons.k8s.io/v1.4.0.yaml
manifestHash: 3ffe9ac576f9eec72e2bdfbd2ea17d56d9b17b90
name: core.addons.k8s.io
selector:
k8s-addon: core.addons.k8s.io
version: 1.4.0
- id: k8s-1.12
manifest: kube-dns.addons.k8s.io/k8s-1.12.yaml
manifestHash: db49c98447b9d59dec4fa413461a6614bc6e43e9
name: kube-dns.addons.k8s.io
selector:
k8s-addon: kube-dns.addons.k8s.io
version: 1.15.13-kops.3
- id: k8s-1.8
manifest: rbac.addons.k8s.io/k8s-1.8.yaml
manifestHash: 5d53ce7b920cd1e8d65d2306d80a041420711914
name: rbac.addons.k8s.io
selector:
k8s-addon: rbac.addons.k8s.io
version: 1.8.0
- id: k8s-1.9
manifest: kubelet-api.rbac.addons.k8s.io/k8s-1.9.yaml
manifestHash: e1508d77cb4e527d7a2939babe36dc350dd83745
name: kubelet-api.rbac.addons.k8s.io
selector:
k8s-addon: kubelet-api.rbac.addons.k8s.io
version: v0.0.1
- manifest: limit-range.addons.k8s.io/v1.5.0.yaml
manifestHash: 2ea50e23f1a5aa41df3724630ac25173738cc90c
name: limit-range.addons.k8s.io
selector:
k8s-addon: limit-range.addons.k8s.io
version: 1.5.0
- id: k8s-1.12
manifest: dns-controller.addons.k8s.io/k8s-1.12.yaml
manifestHash: 8b44f8925352ceb1e59d8edd66bb4e0471a11440
name: dns-controller.addons.k8s.io
selector:
k8s-addon: dns-controller.addons.k8s.io
version: 1.19.0-beta.2
- id: v1.15.0
kubernetesVersion: '>=1.15.0'
manifest: storage-aws.addons.k8s.io/v1.15.0.yaml
manifestHash: 00cf6e46e25b736b2da93c6025ce482474d83904
name: storage-aws.addons.k8s.io
selector:
k8s-addon: storage-aws.addons.k8s.io
version: 1.17.0
- id: v1.7.0
kubernetesVersion: <1.15.0
manifest: storage-aws.addons.k8s.io/v1.7.0.yaml
manifestHash: 62705a596142e6cc283280e8aa973e51536994c5
name: storage-aws.addons.k8s.io
selector:
k8s-addon: storage-aws.addons.k8s.io
version: 1.17.0
- id: k8s-1.12
kubernetesVersion: <1.16.0
manifest: networking.amazon-vpc-routed-eni/k8s-1.12.yaml
manifestHash: 1b204a83ef58e8b268970861bb18ff2df597c86a
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: 9ee6f14c2919f1744bd3ef7c8a01ff3c4a111511
name: networking.amazon-vpc-routed-eni
selector:
role.kubernetes.io/networking: "1"
version: 1.7.8-kops.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
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

---

apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
k8s-app: aws-node
name: aws-node
namespace: kube-system
spec:
selector:
matchLabels:
k8s-app: aws-node
template:
metadata:
labels:
k8s-app: aws-node
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux
- key: beta.kubernetes.io/arch
operator: In
values:
- amd64
containers:
- env:
- name: CLUSTER_NAME
value: minimal.example.com
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: DEBUG
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: WARM_IP_TARGET
value: "10"
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: debug
image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.5
imagePullPolicy: Always
name: aws-node
ports:
- containerPort: 61678
name: metrics
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
hostNetwork: true
priorityClassName: system-node-critical
serviceAccountName: aws-node
tolerations:
- operator: Exists
volumes:
- hostPath:
path: /opt/cni/bin
name: cni-bin-dir
- hostPath:
path: /etc/cni/net.d
name: cni-net-dir
- hostPath:
path: /var/log
name: log-dir
- hostPath:
path: /var/run/docker.sock
name: dockersock
updateStrategy:
type: RollingUpdate

---

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: eniconfigs.crd.k8s.amazonaws.com
spec:
group: crd.k8s.amazonaws.com
names:
kind: ENIConfig
plural: eniconfigs
singular: eniconfig
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
Loading