Skip to content

Commit

Permalink
update multus to 3.4 and add crio support (kubernetes-sigs#5701)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Randles <[email protected]>
  • Loading branch information
crandles authored Mar 13, 2020
1 parent 19865e8 commit 71c8568
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Note: Upstart/SysV init based OS types are not supported.
- [contiv](https://github.com/contiv/install) v1.2.1
- [flanneld](https://github.com/coreos/flannel) v0.11.0
- [kube-router](https://github.com/cloudnativelabs/kube-router) v0.2.5
- [multus](https://github.com/intel/multus-cni) v3.2.1
- [multus](https://github.com/intel/multus-cni) v3.4
- [weave](https://github.com/weaveworks/weave) v2.5.2
- Application
- [cephfs-provisioner](https://github.com/kubernetes-incubator/external-storage) v2.1.0-k8s1.11
Expand Down
2 changes: 1 addition & 1 deletion roles/download/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ contiv_version: 1.2.1
cilium_version: "v1.7.1"
kube_ovn_version: "v0.6.0"
kube_router_version: "v0.2.5"
multus_version: "v3.2.1"
multus_version: "v3.4"

# Get kubernetes major version (i.e. 1.15.4 => 1.15)
kube_major_version: "{{ kube_version | regex_replace('^v([0-9])+\\.([0-9]+)\\.[0-9]+', 'v\\1.\\2') }}"
Expand Down
5 changes: 4 additions & 1 deletion roles/network_plugin/multus/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
multus_conf_file: "auto"
multus_cni_conf_dir_host: "/etc/cni/net.d"
multus_cni_bin_dir_host: "/opt/cni/bin"
multus_cni_bin_dir_host: "{{ '/usr/libexec/cni' if container_manager == 'crio' else '/opt/cni/bin' }}"
multus_cni_run_dir_host: "/run"
multus_cni_conf_dir: "{{ ('/host', multus_cni_conf_dir_host) | join }}"
multus_cni_bin_dir: "{{ ('/host', multus_cni_bin_dir_host) | join }}"
multus_cni_run_dir: "{{ ('/host', multus_cni_run_dir_host) | join }}"
multus_cni_version: "0.3.1"
multus_kubeconfig_file_host: "{{ (multus_cni_conf_dir_host, '/multus.d/multus.kubeconfig') | join }}"
13 changes: 8 additions & 5 deletions roles/network_plugin/multus/files/multus-clusterrole.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: multus
rules:
- apiGroups:
- '*'
- apiGroups: ["k8s.cni.cncf.io"]
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
- apiGroups:
- ""
resources:
- pods
- pods/status
verbs:
- '*'
- get
- update
23 changes: 14 additions & 9 deletions roles/network_plugin/multus/files/multus-crd.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1beta1
metadata:
name: network-attachment-definitions.k8s.cni.cncf.io
spec:
group: k8s.cni.cncf.io
version: v1
scope: Namespaced
names:
plural: network-attachment-definitions
singular: network-attachment-definition
kind: NetworkAttachmentDefinition
shortNames:
- net-attach-def
validation:
openAPIV3Schema:
properties:
spec:
properties:
config:
type: string
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
config:
type: string
17 changes: 17 additions & 0 deletions roles/network_plugin/multus/templates/multus-daemonset.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
- "--cni-bin-dir={{ multus_cni_bin_dir }}"
- "--multus-conf-file={{ multus_conf_file }}"
- "--multus-kubeconfig-file-host={{ multus_kubeconfig_file_host }}"
- "--cni-version={{ multus_cni_version }}"
{% if container_manager == 'crio' %}
- "--restart-crio=true"
{% endif %}
resources:
requests:
cpu: "100m"
Expand All @@ -45,12 +49,25 @@ spec:
memory: "50Mi"
securityContext:
privileged: true
{% if container_manager == 'crio' %}
capabilities:
add: ["SYS_ADMIN"]
{% endif %}
volumeMounts:
{% if container_manager == 'crio' %}
- name: run
mountPath: {{ multus_cni_run_dir }}
{% endif %}
- name: cni
mountPath: {{ multus_cni_conf_dir }}
- name: cnibin
mountPath: {{ multus_cni_bin_dir }}
volumes:
{% if container_manager == 'crio' %}
- name: run
hostPath:
path: {{ multus_cni_run_dir_host }}
{% endif %}
- name: cni
hostPath:
path: {{ multus_cni_conf_dir_host }}
Expand Down

0 comments on commit 71c8568

Please sign in to comment.