Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 088c34e

Browse files
committed
adding deployment file
Signed-off-by: John O'Loughlin <[email protected]>
1 parent 8110381 commit 088c34e

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Diff for: Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ help:
1313
@echo "make build - Build UserSpace CNI container."
1414
@echo "make deploy - Copy binary from container to host: /opt/cni/bin."
1515
@echo "make all - build and deploy"
16+
@echo "make rollout - kubectl apply daemonset"
1617

1718
build:
1819
@$(IMAGE_BUILDER) build . -f ./docker/userspacecni/Dockerfile -t $(IMAGE_NAME)
@@ -23,8 +24,14 @@ deploy:
2324
@$(IMAGE_BUILDER) run -it --rm -v /opt/cni/bin/:/opt/cni/bin/ $(IMAGE_NAME)
2425

2526
generate-bin: generate
27+
# Used in dockerfile
2628
@cd userspace && go build -v
2729

2830
generate:
31+
# Used in dockerfile
2932
for package in cnivpp/api/* ; do cd $$package ; pwd ; go generate ; cd - ; done
3033

34+
rollout:
35+
# Use sed to replace image name and then apply deploument file
36+
sed "s|\(image:\).*\(#registory\)|\1 $(IMAGE_NAME) \2|g" ./kubernetes/userspace-daemonset.yml |kubectl apply -f -
37+

Diff for: kubernetes/userspace-daemonset.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: DaemonSet
4+
metadata:
5+
name: userspace-cni
6+
namespace: kube-system
7+
spec:
8+
selector:
9+
matchLabels:
10+
app: userspace-cni
11+
template:
12+
metadata:
13+
labels:
14+
app: userspace-cni
15+
spec:
16+
initContainers:
17+
- name: userspace-cni-plugin
18+
image: localhost:5000/userspacecni #registory:imagename
19+
imagePullPolicy: IfNotPresent
20+
volumeMounts:
21+
- name: cnibin
22+
mountPath: /opt/cni/bin
23+
volumes:
24+
- name: cnibin
25+
hostPath:
26+
path: /opt/cni/bin
27+
containers:
28+
- name: pause
29+
image: gcr.io/google_containers/pause

0 commit comments

Comments
 (0)