Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions reference-cni-plugin-install/reference-cni-daemonset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cni-binary-copy-script
namespace: kube-system
annotations:
kubernetes.io/description: |
This is a script used to copy CNI binaries
data:
cnibincopy.sh: |-
#!/bin/bash
cp -f /usr/src/plugins/bin/* /host/opt/cni/bin
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-containernetworking-plugins-ds-amd64
namespace: kube-system
labels:
tier: node
app: containernetworking-plugins
name: containernetworking-plugins
spec:
selector:
matchLabels:
name: containernetworking-plugins
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
tier: node
app: containernetworking-plugins
name: containernetworking-plugins
spec:
hostNetwork: true
nodeSelector:
kubernetes.io/arch: amd64
tolerations:
- operator: Exists
effect: NoSchedule
initContainers:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering why do we need initContainer here? Can we use it as a regular container?

- name: containernetworking-binary-copy
image: nfvpe/containernetworking-plugins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use ghcr.io/k8snetworkplumbingwg repository

command: ["/entrypoint/cnibincopy.sh"]
securityContext:
privileged: true
volumeMounts:
- name: cni-binary-copy
mountPath: /entrypoint
- name: cnibin
mountPath: /host/opt/cni/bin
volumes:
- name: cnibin
hostPath:
path: /opt/cni/bin
- name: cni-binary-copy
configMap:
name: cni-binary-copy-script
defaultMode: 0744
containers:
- name: kube-containernetworking-plugins
image: busybox
command: ["sleep"]
args: ["infinity"]
resources:
requests:
cpu: "100m"
memory: "50Mi"
limits:
cpu: "100m"
memory: "50Mi"