Skip to content

Commit

Permalink
Merge pull request #495 from village-way/main
Browse files Browse the repository at this point in the history
add make node-agent target and improve the cmd return formate
  • Loading branch information
kosmos-robot authored Apr 29, 2024
2 parents 5eb2ed8 + 1ffc472 commit 1563d25
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 596 deletions.
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

0 comments on commit 1563d25

Please sign in to comment.