Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add init cni process #526

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Add init cni process #526

merged 2 commits into from
Feb 2, 2024

Conversation

IdeaMeshDyx
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:

this pr provide an init process for cni install , when detect that the node is edge and the following two step will be doing:

  • copy cni to /opt/cni/bin/egdemesh-cni
  • copy 10-edgemesh-cni.conflist to /etc/cni/net.d/

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@kubeedge-bot kubeedge-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 26, 2023
@kubeedge-bot kubeedge-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 26, 2023
echo "Edgecore process is running. Continuing with the initialization steps."

# copy cni to host
cp -f /usr/local/bin/edgemesh-cni /opt/cni/bin/egdemesh-cni
Copy link
Contributor

Choose a reason for hiding this comment

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

建议参照, multus-CNI的做法

	rm -f /host/opt/cni/bin/spiderpool.old || true
	( [ -f "/host/opt/cni/bin/spiderpool" ] && mv /host/opt/cni/bin/spiderpool /host/opt/cni/bin/spiderpool.old ) || true
	cp /usr/bin/spiderpool /host/opt/cni/bin/spiderpool
	rm -f /host/opt/cni/bin/spiderpool.old &>/dev/null  || true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的已经修改

@@ -14,6 +14,7 @@ FROM alpine:3.11
RUN apk update && apk --no-cache add iptables && apk --no-cache add dpkg

COPY --from=builder /code/_output/local/bin/edgemesh-agent /usr/local/bin/edgemesh-agent
COPY --from=builder /code/_output/local/bin/edgemesh-cni /usr/local/bin/edgemesh-cni
Copy link
Member

Choose a reason for hiding this comment

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

为什么不新增一个 build/cni/Dockerfile 去放?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

欧克,已经分离出单独的安装容器

Comment on lines 21 to 34
initContainers:
- name: install-edgemesh-cni
image: kubeedge/edgemesh-agent:v1.14.0
command:
- sh
- -c
- /usr/local/init-cni.sh
volumeMounts:
- name: cni-plugin
mountPath: /opt/cni/bin
- name: cni-cfg
mountPath: /etc/cni/net.d
- name: edgemesh-cfg
mountPath: /etc/edgemesh/
Copy link
Contributor

Choose a reason for hiding this comment

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

@IdeaMeshDyx
如果说{{- if .Values.modules.edgeCNI }}开关控制是否安装edgeMesh CNI,则可给initContainer处加上该判断语句。
并给spiderpool的helm install的最外层也包上该判断语句,即可实现helm安装edgemesh CNI时,自动带上spiderpool IPAM插件无需额外手动安装

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,改用 subcharts 去做

@kubeedge-bot kubeedge-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 19, 2024
@Icarus9913
Copy link
Contributor

先给edgemesh/build/helm/edgemesh/values.yaml 补充spiderpool的values值

spiderpool:
  multus:
    enableMultusConfig: false
    multusCNI:
      install: false
  plugins:
    installCNI: false
    installRdmaCNI: false
    installOvsCNI: false
    installibSriovCNI: false
    installIpoibCNI: false
  coordinator:
    enabled: false

@Icarus9913
Copy link
Contributor

额外需要一个脚本,可以将最新的spiderpool的charts覆盖 edgemesh/build/helm/edgemesh/charts/spiderpool这个charts文件夹

Signed-off-by: ideameshdyx <[email protected]>
@IdeaMeshDyx
Copy link
Contributor Author

额外需要一个脚本,可以将最新的spiderpool的charts覆盖 edgemesh/build/helm/edgemesh/charts/spiderpool这个charts文件夹

更新values的方式还是依照helm的规则做,放在上一级value中

@Poorunga
Copy link
Member

Poorunga commented Feb 2, 2024

/lgtm
/approve

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2024
@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Poorunga

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2024
@kubeedge-bot kubeedge-bot merged commit c66ec38 into kubeedge:main Feb 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants