-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Claes Mogren
committed
May 13, 2020
1 parent
66389b1
commit 5adddfb
Showing
7 changed files
with
292 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ aws-k8s-agent | |
cni-metrics-helper | ||
grpc-health-probe | ||
portmap | ||
loopback | ||
routed-eni-cni-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: aws-node | ||
rules: | ||
- apiGroups: | ||
- crd.k8s.amazonaws.com | ||
resources: | ||
- "*" | ||
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: "kubernetes.io/os" | ||
operator: In | ||
values: | ||
- linux | ||
- key: "kubernetes.io/arch" | ||
operator: In | ||
values: | ||
- amd64 | ||
- key: "eks.amazonaws.com/compute-type" | ||
operator: NotIn | ||
values: | ||
- fargate | ||
- 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: | ||
- name: aws-node | ||
image: 973117571331.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:master | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 61678 | ||
name: metrics | ||
livenessProbe: | ||
exec: | ||
command: ["/app/grpc-health-probe", "-addr=:50051"] | ||
initialDelaySeconds: 35 | ||
env: | ||
- name: AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER | ||
value: "false" | ||
- 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: | ||
capabilities: | ||
add: ["NET_ADMIN"] | ||
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/dockershim.sock | ||
name: dockershim | ||
initContainers: | ||
- name: aws-vpc-cni-init | ||
image: 973117571331.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:master | ||
imagePullPolicy: Always | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- mountPath: /host/opt/cni/bin | ||
name: cni-bin-dir | ||
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: 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG docker_arch | ||
ARG golang_image=golang:1.13-stretch | ||
|
||
FROM $golang_image as builder | ||
WORKDIR /go/src/github.com/aws/amazon-vpc-cni-k8s | ||
ARG GOARCH | ||
# Configure build with Go modules | ||
ENV GO111MODULE=on | ||
ENV GOPROXY=direct | ||
|
||
COPY Makefile ./ | ||
RUN make plugins && make debug-script | ||
|
||
COPY . ./ | ||
|
||
# Build the architecture specific container image: | ||
FROM $docker_arch/amazonlinux:2 | ||
RUN yum update -y && \ | ||
yum install -y iproute procps-ng && \ | ||
yum clean all | ||
|
||
WORKDIR /init | ||
|
||
COPY --from=builder \ | ||
/go/src/github.com/aws/amazon-vpc-cni-k8s/loopback \ | ||
/go/src/github.com/aws/amazon-vpc-cni-k8s/portmap \ | ||
/go/src/github.com/aws/amazon-vpc-cni-k8s/aws-cni-support.sh \ | ||
/go/src/github.com/aws/amazon-vpc-cni-k8s/scripts/init.sh /init/ | ||
|
||
ENTRYPOINT /init/init.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.