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 make node-agent target and improve the cmd return formate #495

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MACOS_TARGETS := clusterlink-controller-manager \
clusterlink-proxy \
clustertree-cluster-manager \
virtual-cluster-operator \
node-agent \
scheduler \

# clusterlink-agent and clusterlink-floater only support linux platform
Expand All @@ -28,6 +29,7 @@ TARGETS := clusterlink-controller-manager \
clusterlink-proxy \
clustertree-cluster-manager \
virtual-cluster-operator \
node-agent \
scheduler \

# If GOOS is macOS, assign the value of MACOS_TARGETS to TARGETS
Expand Down Expand Up @@ -125,7 +127,8 @@ upload-images: images
docker push ${REGISTRY}/clusterlink-floater:${VERSION}
docker push ${REGISTRY}/clusterlink-elector:${VERSION}
docker push ${REGISTRY}/clustertree-cluster-manager:${VERSION}
docker push ${REGISTRY}/virtual-cluster-operator:${VERSION}
docker push ${REGISTRY}/virtual-cluster-operator:${VERSION}
docker push ${REGISTRY}/node-agent:${VERSION}
docker push ${REGISTRY}/scheduler:${VERSION}

.PHONY: release
Expand Down
17 changes: 17 additions & 0 deletions cluster/images/agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:latest as release-env

ARG BINARY

WORKDIR /app
# copy install file to container
# build context is _output/xx/xx
COPY agent/* .

# install rsync
RUN apt-get update && apt-get install -y rsync pwgen openssl && \
openssl req -x509 -sha256 -new -nodes -days 3650 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/O=Kosmos/OU=Kosmos/CN=kosmos.io"

COPY ${BINARY} /app

# install command
CMD ["bash", "/app/install.sh", "/app"]
17 changes: 17 additions & 0 deletions cluster/images/buildx.agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:latest as release-env

ARG BINARY
ARG TARGETPLATFORM

WORKDIR /app
# copy install file to container
COPY ${TARGETPLATFORM}/agent/* .

# install rsync
RUN apt-get update && apt-get install -y rsync pwgen openssl && \
openssl req -x509 -sha256 -new -nodes -days 3650 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/O=Kosmos/OU=Kosmos/CN=kosmos.io"

COPY ${TARGETPLATFORM}/${BINARY} /app

# install command
CMD ["bash", "/app/install.sh", "/app"]
45 changes: 0 additions & 45 deletions cmd/kubenest/node-agent/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func handleCmd(conn *websocket.Conn, params url.Values) {
out, err := cmd.CombinedOutput()
if err != nil {
log.Warnf("failed to execute command : %v", err)
_ = conn.WriteMessage(websocket.TextMessage, []byte(err.Error()))
_ = conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, fmt.Sprintf("%d", cmd.ProcessState.ExitCode())))
} else {
_ = conn.WriteMessage(websocket.TextMessage, out)
}
Expand Down
273 changes: 0 additions & 273 deletions cmd/kubenest/node-agent/app.py

This file was deleted.

Loading
Loading