File tree 5 files changed +98
-6
lines changed
5 files changed +98
-6
lines changed Original file line number Diff line number Diff line change @@ -29,26 +29,33 @@ jobs:
29
29
with :
30
30
go-version : 1.20.5
31
31
32
+ - name : Build cnivpc
33
+ run : DEPLOY=true make cnivpc
34
+
32
35
- name : Build ipamd
33
36
run : DEPLOY=true make ipamd
34
37
35
38
- name : Build vip-controller
36
39
run : DEPLOY=true make vip-controller
37
40
38
- - name : Build cni
39
- run : make cni
40
-
41
41
- name : Package cni
42
42
run : >
43
43
tar -cv
44
44
LICENSE README.md
45
45
-C bin/ cnivpc cnivpctl
46
+ -C config/ 10-cnivpc.conf
46
47
| gzip --best
47
48
> 'uk8s-cni-vpc_${{ steps.get_version.outputs.VERSION }}.tar.gz'
48
49
49
50
- name : Create release
50
51
uses : softprops/action-gh-release@v1
51
52
with :
52
53
draft : true
54
+ body : |
55
+ ## Docker Images
56
+
57
+ - uhub.service.ucloud.cn/uk8s/cni-vpc-node:${{ steps.get_version.outputs.VERSION }}
58
+ - uhub.service.ucloud.cn/uk8s/cni-vpc-ipamd:${{ steps.get_version.outputs.VERSION }}
59
+ - uhub.service.ucloud.cn/uk8s/vip-controller:${{ steps.get_version.outputs.VERSION }}
53
60
files : |
54
61
*.tar.gz
Original file line number Diff line number Diff line change @@ -24,18 +24,25 @@ DOCKER_TEST_BUCKET=uhub.service.ucloud.cn/wxyz
24
24
DOCKER_LABEL: =$(if $(DEPLOY ) ,$(CNI_VERSION ) ,dev-$(COMMIT_ID_SHORT ) )
25
25
DOCKER_BUCKET: =$(if $(DEPLOY ) ,$(DOCKER_DEPLOY_BUCKET ) ,$(DOCKER_TEST_BUCKET ) )
26
26
27
+ CNIVPC_IMAGE: =$(DOCKER_BUCKET ) /cni-vpc-node:$(DOCKER_LABEL )
27
28
IPAMD_IMAGE: =$(DOCKER_BUCKET ) /cni-vpc-ipamd:$(DOCKER_LABEL )
28
29
VIP_CONTROLLER_IMAGE: =$(DOCKER_BUCKET ) /vip-controller:$(DOCKER_LABEL )
29
30
30
31
DOCKER_CMD: =$(if $(DOCKER_CMD ) ,$(DOCKER_CMD ) ,docker)
31
32
32
- all : cni
33
+ all : cnivpc
33
34
34
- .PHONY : cni
35
- cni :
35
+ .PHONY : cnivpc-bin
36
+ cnivpc-bin :
36
37
go build ${LDFLAGS} -o ./bin/cnivpc ./cmd/cnivpc
37
38
go build ${LDFLAGS} -o ./bin/cnivpctl ./cmd/cnivpctl
38
39
40
+ .PHONY : cnivpc
41
+ cnivpc : cnivpc-bin
42
+ $(DOCKER_CMD ) build -t $(CNIVPC_IMAGE ) -f dockerfiles/cnivpc/Dockerfile .
43
+ $(DOCKER_CMD ) push $(CNIVPC_IMAGE )
44
+ @echo " Build done: $( CNIVPC_IMAGE) "
45
+
39
46
.PHONY : ipamd
40
47
ipamd :
41
48
go build ${LDFLAGS} -o ./bin/cnivpc-ipamd ./cmd/cnivpc-ipamd
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : DaemonSet
3
+ metadata :
4
+ name : cni-vpc-node
5
+ namespace : kube-system
6
+ labels :
7
+ app : " cni-vpc-node"
8
+ spec :
9
+ selector :
10
+ matchLabels :
11
+ app : " cni-vpc-node"
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : " cni-vpc-node"
16
+ spec :
17
+ tolerations :
18
+ - key : CriticalAddonsOnly
19
+ operator : Exists
20
+ - key : dedicated
21
+ operator : Exists
22
+ - effect : NoSchedule
23
+ key : node.cloudprovider.kubernetes.io/uninitialized
24
+ value : " true"
25
+ hostNetwork : true
26
+ priorityClassName : system-node-critical
27
+ hostPID : true
28
+ containers :
29
+ - name : cni-vpc-node
30
+ image : uhub.service.ucloud.cn/uk8s/cni-vpc-node:1.0.1
31
+ securityContext :
32
+ privileged : true
33
+ imagePullPolicy : " Always"
34
+ volumeMounts :
35
+ - name : host-cni
36
+ mountPath : /opt/cni/
37
+ - name : host-bin
38
+ mountPath : /host-bin
39
+ - name : host-log
40
+ mountPath : /var/log
41
+ readOnly : true
42
+ volumes :
43
+ - name : host-cni
44
+ hostPath :
45
+ path : /opt/cni
46
+ - name : host-bin
47
+ hostPath :
48
+ path : /usr/local/bin
49
+ - name : host-log
50
+ hostPath :
51
+ path : /var/log
Original file line number Diff line number Diff line change
1
+ FROM alpine:latest
2
+
3
+ COPY bin/cnivpc /usr/local/bin/
4
+ COPY bin/cnivpctl /usr/local/bin/
5
+ COPY scripts/cnivpc-docker-entrypoint.sh /entrypoint.sh
6
+ COPY config/10-cnivpc.conf /10-cnivpc.conf
7
+
8
+ ENTRYPOINT [ "/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ if [[ -d /opt/cni ]]; then
4
+ cp -f /usr/local/bin/cnivpc /opt/cni/bin/cnivpc
5
+ cp -f /10-cnivpc.conf /opt/cni/net.d/10-cnivpc.conf
6
+ fi
7
+
8
+ if [[ -d /host-bin ]]; then
9
+ cp -f /usr/local/bin/cnivpctl /host-bin/cnivpctl
10
+ fi
11
+
12
+ while true ; do
13
+ if [[ ! -f " /var/log/cnivpc.log" ]]; then
14
+ echo " waitting for cnivpc logs..."
15
+ sleep 3
16
+ continue
17
+ fi
18
+ tail -f /var/log/cnivpc.log
19
+ done
You can’t perform that action at this time.
0 commit comments