KubeZero/charts/kubezero-network/templates/multus/daemonset.yaml

157 lines
3.5 KiB
YAML
Raw Normal View History

2021-12-01 12:35:18 +00:00
{{- if .Values.multus.enabled }}
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: |
{
"cniVersion": "0.3.1",
"name": "multus-cni-network",
"type": "multus",
"kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig",
"delegates": [
{
"cniVersion": "0.3.1",
"name": "cilium",
"type": "cilium-cni",
"enable-debug": false
}
]
}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-multus-ds
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
tolerations:
- operator: Exists
effect: NoSchedule
2022-01-28 16:22:39 +00:00
- operator: Exists
effect: NoExecute
2021-12-01 12:35:18 +00:00
serviceAccountName: multus
containers:
- name: kube-multus
image: ghcr.io/k8snetworkplumbingwg/multus-cni:{{ .Values.multus.tag }}
command: ["/entrypoint.sh"]
args:
- "--multus-conf-file=auto"
2022-01-28 16:22:39 +00:00
- "--rename-conf-file=true"
2021-12-01 12:35:18 +00:00
- "--cni-version=0.3.1"
resources:
requests:
cpu: "100m"
memory: "50Mi"
limits:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: true
2021-12-21 15:05:08 +00:00
capabilities:
add: ["SYS_ADMIN"]
2021-12-01 12:35:18 +00:00
volumeMounts:
2021-12-21 15:05:08 +00:00
- name: run
mountPath: /run
2021-12-01 12:35:18 +00:00
- name: cni
mountPath: /host/etc/cni/net.d
- name: cnibin
2021-12-21 22:38:11 +00:00
mountPath: /host/opt/cni/bin
2021-12-01 12:35:18 +00:00
- name: multus-cfg
mountPath: /tmp/multus-conf
terminationGracePeriodSeconds: 10
volumes:
2021-12-21 15:05:08 +00:00
- name: run
hostPath:
path: /run
2021-12-01 12:35:18 +00:00
- name: cni
hostPath:
path: /etc/cni/net.d
- name: cnibin
hostPath:
2021-12-21 22:38:11 +00:00
path: /opt/cni/bin
2021-12-01 12:35:18 +00:00
- name: multus-cfg
configMap:
name: multus-cni-config
items:
- key: cni-conf.json
path: 70-multus.conf
{{- end }}