|
| 1 | +--- |
| 2 | +apiVersion: apiextensions.k8s.io/v1 |
| 3 | +kind: CustomResourceDefinition |
| 4 | +metadata: |
| 5 | + name: network-attachment-definitions.k8s.cni.cncf.io |
| 6 | +spec: |
| 7 | + group: k8s.cni.cncf.io |
| 8 | + scope: Namespaced |
| 9 | + names: |
| 10 | + plural: network-attachment-definitions |
| 11 | + singular: network-attachment-definition |
| 12 | + kind: NetworkAttachmentDefinition |
| 13 | + shortNames: |
| 14 | + - net-attach-def |
| 15 | + versions: |
| 16 | + - name: v1 |
| 17 | + served: true |
| 18 | + storage: true |
| 19 | + schema: |
| 20 | + openAPIV3Schema: |
| 21 | + description: 'NetworkAttachmentDefinition is a CRD schema specified by the Network Plumbing |
| 22 | + Working Group to express the intent for attaching pods to one or more logical or physical |
| 23 | + networks. More information available at: https://github.com/k8snetworkplumbingwg/multi-net-spec' |
| 24 | + type: object |
| 25 | + properties: |
| 26 | + apiVersion: |
| 27 | + description: 'APIVersion defines the versioned schema of this represen |
| 28 | + tation of an object. Servers should convert recognized schemas to the |
| 29 | + latest internal value, and may reject unrecognized values. More info: |
| 30 | + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' |
| 31 | + type: string |
| 32 | + kind: |
| 33 | + description: 'Kind is a string value representing the REST resource this |
| 34 | + object represents. Servers may infer this from the endpoint the client |
| 35 | + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' |
| 36 | + type: string |
| 37 | + metadata: |
| 38 | + type: object |
| 39 | + spec: |
| 40 | + description: 'NetworkAttachmentDefinition spec defines the desired state of a network attachment' |
| 41 | + type: object |
| 42 | + properties: |
| 43 | + config: |
| 44 | + description: 'NetworkAttachmentDefinition config is a JSON-formatted CNI configuration' |
| 45 | + type: string |
| 46 | +--- |
| 47 | +kind: ClusterRole |
| 48 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 49 | +metadata: |
| 50 | + name: multus |
| 51 | +rules: |
| 52 | + - apiGroups: ["k8s.cni.cncf.io"] |
| 53 | + resources: |
| 54 | + - '*' |
| 55 | + verbs: |
| 56 | + - '*' |
| 57 | + - apiGroups: |
| 58 | + - "" |
| 59 | + resources: |
| 60 | + - pods |
| 61 | + - pods/status |
| 62 | + verbs: |
| 63 | + - get |
| 64 | + - list |
| 65 | + - update |
| 66 | + - watch |
| 67 | + - apiGroups: |
| 68 | + - "" |
| 69 | + - events.k8s.io |
| 70 | + resources: |
| 71 | + - events |
| 72 | + verbs: |
| 73 | + - create |
| 74 | + - patch |
| 75 | + - update |
| 76 | +--- |
| 77 | +kind: ClusterRoleBinding |
| 78 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 79 | +metadata: |
| 80 | + name: multus |
| 81 | +roleRef: |
| 82 | + apiGroup: rbac.authorization.k8s.io |
| 83 | + kind: ClusterRole |
| 84 | + name: multus |
| 85 | +subjects: |
| 86 | + - kind: ServiceAccount |
| 87 | + name: multus |
| 88 | + namespace: kube-system |
| 89 | +--- |
| 90 | +apiVersion: v1 |
| 91 | +kind: ServiceAccount |
| 92 | +metadata: |
| 93 | + name: multus |
| 94 | + namespace: kube-system |
| 95 | +--- |
| 96 | +kind: ConfigMap |
| 97 | +apiVersion: v1 |
| 98 | +metadata: |
| 99 | + name: multus-daemon-config |
| 100 | + namespace: kube-system |
| 101 | + labels: |
| 102 | + tier: node |
| 103 | + app: multus |
| 104 | +data: |
| 105 | + daemon-config.json: | |
| 106 | + { |
| 107 | + "chrootDir": "/hostroot", |
| 108 | + "confDir": "/host/etc/cni/net.d", |
| 109 | + "logFile": "/var/log/multus.log", |
| 110 | + "logLevel": "verbose", |
| 111 | + "socketDir": "/host/run/multus/", |
| 112 | + "cniVersion": "0.3.1", |
| 113 | + "logToStderr": true, |
| 114 | + "cniConfigDir": "/host/etc/cni/net.d", |
| 115 | + "multusConfigFile": "auto", |
| 116 | + "multusAutoconfigDir": "/host/etc/cni/net.d", |
| 117 | + "multusMasterCNI": "10-aws.conflist" |
| 118 | + } |
| 119 | +--- |
| 120 | +apiVersion: apps/v1 |
| 121 | +kind: DaemonSet |
| 122 | +metadata: |
| 123 | + name: kube-multus-ds |
| 124 | + namespace: kube-system |
| 125 | + labels: |
| 126 | + tier: node |
| 127 | + app: multus |
| 128 | + name: multus |
| 129 | +spec: |
| 130 | + selector: |
| 131 | + matchLabels: |
| 132 | + name: multus |
| 133 | + updateStrategy: |
| 134 | + type: RollingUpdate |
| 135 | + template: |
| 136 | + metadata: |
| 137 | + labels: |
| 138 | + tier: node |
| 139 | + app: multus |
| 140 | + name: multus |
| 141 | + spec: |
| 142 | + affinity: |
| 143 | + nodeAffinity: |
| 144 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 145 | + nodeSelectorTerms: |
| 146 | + - matchExpressions: |
| 147 | + - key: kubernetes.io/os |
| 148 | + operator: In |
| 149 | + values: |
| 150 | + - linux |
| 151 | + - key: eks.amazonaws.com/compute-type |
| 152 | + operator: NotIn |
| 153 | + values: |
| 154 | + - fargate |
| 155 | + hostNetwork: true |
| 156 | + hostPID: true |
| 157 | + tolerations: |
| 158 | + - operator: Exists |
| 159 | + effect: NoSchedule |
| 160 | + - operator: Exists |
| 161 | + effect: NoExecute |
| 162 | + serviceAccountName: multus |
| 163 | + containers: |
| 164 | + - name: kube-multus |
| 165 | + image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/multus-cni:v4.1.4-eksbuild.1_thick |
| 166 | + command: [ "/usr/src/multus-cni/bin/multus-daemon" ] |
| 167 | + resources: |
| 168 | + requests: |
| 169 | + cpu: "100m" |
| 170 | + memory: "50Mi" |
| 171 | + limits: |
| 172 | + cpu: "100m" |
| 173 | + memory: "50Mi" |
| 174 | + securityContext: |
| 175 | + privileged: true |
| 176 | + terminationMessagePolicy: FallbackToLogsOnError |
| 177 | + volumeMounts: |
| 178 | + - name: cni |
| 179 | + mountPath: /host/etc/cni/net.d |
| 180 | + # multus-daemon expects that cnibin path must be identical between pod and container host. |
| 181 | + |
| 182 | + # e.g. if the cni bin is in '/opt/cni/bin' on the container host side, then it should be mount to '/opt/cni/bin' in multus-daemon, |
| 183 | + |
| 184 | + # not to any other directory, like '/opt/bin' or '/usr/bin'. |
| 185 | + |
| 186 | + - name: cnibin |
| 187 | + mountPath: /opt/cni/bin |
| 188 | + - name: host-run |
| 189 | + mountPath: /host/run |
| 190 | + - name: host-var-lib-cni-multus |
| 191 | + mountPath: /var/lib/cni/multus |
| 192 | + - name: host-var-lib-kubelet |
| 193 | + mountPath: /var/lib/kubelet |
| 194 | + mountPropagation: HostToContainer |
| 195 | + - name: host-run-k8s-cni-cncf-io |
| 196 | + mountPath: /run/k8s.cni.cncf.io |
| 197 | + - name: host-run-netns |
| 198 | + mountPath: /run/netns |
| 199 | + mountPropagation: HostToContainer |
| 200 | + - name: multus-daemon-config |
| 201 | + mountPath: /etc/cni/net.d/multus.d |
| 202 | + readOnly: true |
| 203 | + - name: hostroot |
| 204 | + mountPath: /hostroot |
| 205 | + mountPropagation: HostToContainer |
| 206 | + env: |
| 207 | + - name: MULTUS_NODE_NAME |
| 208 | + valueFrom: |
| 209 | + fieldRef: |
| 210 | + fieldPath: spec.nodeName |
| 211 | + initContainers: |
| 212 | + - name: install-multus-binary |
| 213 | + image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/multus-cni:v4.1.4-eksbuild.1_thick |
| 214 | + command: |
| 215 | + - "cp" |
| 216 | + - "/usr/src/multus-cni/bin/multus-shim" |
| 217 | + - "/host/opt/cni/bin/multus-shim" |
| 218 | + resources: |
| 219 | + requests: |
| 220 | + cpu: "10m" |
| 221 | + memory: "15Mi" |
| 222 | + securityContext: |
| 223 | + privileged: true |
| 224 | + terminationMessagePolicy: FallbackToLogsOnError |
| 225 | + volumeMounts: |
| 226 | + - name: cnibin |
| 227 | + mountPath: /host/opt/cni/bin |
| 228 | + mountPropagation: Bidirectional |
| 229 | + terminationGracePeriodSeconds: 10 |
| 230 | + volumes: |
| 231 | + - name: cni |
| 232 | + hostPath: |
| 233 | + path: /etc/cni/net.d |
| 234 | + - name: cnibin |
| 235 | + hostPath: |
| 236 | + path: /opt/cni/bin |
| 237 | + - name: hostroot |
| 238 | + hostPath: |
| 239 | + path: / |
| 240 | + - name: multus-daemon-config |
| 241 | + configMap: |
| 242 | + name: multus-daemon-config |
| 243 | + items: |
| 244 | + - key: daemon-config.json |
| 245 | + path: daemon-config.json |
| 246 | + - name: host-run |
| 247 | + hostPath: |
| 248 | + path: /run |
| 249 | + - name: host-var-lib-cni-multus |
| 250 | + hostPath: |
| 251 | + path: /var/lib/cni/multus |
| 252 | + - name: host-var-lib-kubelet |
| 253 | + hostPath: |
| 254 | + path: /var/lib/kubelet |
| 255 | + - name: host-run-k8s-cni-cncf-io |
| 256 | + hostPath: |
| 257 | + path: /run/k8s.cni.cncf.io |
| 258 | + - name: host-run-netns |
| 259 | + hostPath: |
| 260 | + path: /run/netns/ |
0 commit comments