Created
May 28, 2020 03:40
-
-
Save s1061123/1aff91e5871d8ab772176e6bf33b1333 to your computer and use it in GitHub Desktop.
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
--- | |
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: network-attachment-definitions.k8s.cni.cncf.io | |
spec: | |
group: k8s.cni.cncf.io | |
scope: Namespaced | |
names: | |
plural: network-attachment-definitions | |
singular: network-attachment-definition | |
kind: NetworkAttachmentDefinition | |
shortNames: | |
- net-attach-def | |
versions: | |
- name: v1 | |
served: true | |
storage: true | |
schema: | |
openAPIV3Schema: | |
type: object | |
properties: | |
spec: | |
type: object | |
properties: | |
config: | |
type: string | |
--- | |
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: multus | |
rules: | |
- apiGroups: ["k8s.cni.cncf.io"] | |
resources: | |
- '*' | |
verbs: | |
- '*' | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
- pods/status | |
verbs: | |
- get | |
- update | |
- apiGroups: | |
- "" | |
- events.k8s.io | |
resources: | |
- events | |
verbs: | |
- create | |
- patch | |
- update | |
--- | |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: multus | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: multus | |
subjects: | |
- kind: ServiceAccount | |
name: multus | |
namespace: kube-system | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: multus | |
namespace: kube-system | |
--- | |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: multus-cni-config | |
namespace: kube-system | |
labels: | |
tier: node | |
app: multus | |
data: | |
# NOTE: If you'd prefer to manually apply a configuration file, you may create one here. | |
# In the case you'd like to customize the Multus installation, you should change the arguments to the Multus pod | |
# change the "args" line below from | |
# - "--multus-conf-file=auto" | |
# to: | |
# "--multus-conf-file=/tmp/multus-conf/70-multus.conf" | |
# Additionally -- you should ensure that the name "70-multus.conf" is the alphabetically first name in the | |
# /etc/cni/net.d/ directory on each node, otherwise, it will not be used by the Kubelet. | |
cni-conf.json: | | |
{ | |
"name": "multus-cni-network", | |
"type": "multus", | |
"capabilities": { | |
"portMappings": true | |
}, | |
"delegates": [ | |
{ | |
"cniVersion": "0.3.1", | |
"name": "default-cni-network", | |
"plugins": [ | |
{ | |
"type": "flannel", | |
"name": "flannel.1", | |
"delegate": { | |
"isDefaultGateway": true, | |
"hairpinMode": true | |
} | |
}, | |
{ | |
"type": "portmap", | |
"capabilities": { | |
"portMappings": true | |
} | |
} | |
] | |
} | |
], | |
"kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig" | |
} | |
--- | |
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: kube-multus-ds-amd64 | |
namespace: kube-system | |
labels: | |
tier: node | |
app: multus | |
name: multus | |
spec: | |
selector: | |
matchLabels: | |
name: multus | |
updateStrategy: | |
type: RollingUpdate | |
template: | |
metadata: | |
labels: | |
tier: node | |
app: multus | |
name: multus | |
spec: | |
hostNetwork: true | |
nodeSelector: | |
kubernetes.io/arch: amd64 | |
tolerations: | |
- operator: Exists | |
effect: NoSchedule | |
serviceAccountName: multus | |
containers: | |
- name: kube-multus | |
image: nfvpe/multus:snapshot | |
#image: quay.io/s1061123/multus-cni:verbose | |
command: ["/entrypoint.sh"] | |
args: | |
- "--cni-version=0.3.1" | |
- "--cni-bin-dir=/host/opt/cni/bin" | |
- "--multus-log-file=/tmp/multus.log" | |
- "--multus-log-level=debug" | |
- "--multus-conf-file=auto" | |
- "--additional-bin-dir=/opt/multus/bin" | |
- "--restart-crio=true" | |
resources: | |
requests: | |
cpu: "100m" | |
memory: "50Mi" | |
limits: | |
cpu: "100m" | |
memory: "50Mi" | |
securityContext: | |
privileged: true | |
capabilities: | |
add: ["SYS_ADMIN"] | |
volumeMounts: | |
- name: run | |
mountPath: /run | |
- name: cni | |
mountPath: /host/etc/cni/net.d | |
- name: cnibin | |
mountPath: /host/opt/cni/bin | |
- name: multus-cfg | |
mountPath: /tmp/multus-conf | |
volumes: | |
- name: run | |
hostPath: | |
path: /run | |
- name: cni | |
hostPath: | |
path: /etc/cni/net.d | |
- name: cnibin | |
hostPath: | |
path: /opt/cni/bin | |
- name: multus-cfg | |
configMap: | |
name: multus-cni-config | |
items: | |
- key: cni-conf.json | |
path: 70-multus.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment