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

When I do compile k3s-arm64 binary it doesn't work #10915

Closed
RonaldFletcher opened this issue Sep 19, 2024 · 8 comments
Closed

When I do compile k3s-arm64 binary it doesn't work #10915

RonaldFletcher opened this issue Sep 19, 2024 · 8 comments

Comments

@RonaldFletcher
Copy link

When I compile the k3s binary by myself,

build k3s

./scripts/download
./scripts/package

I get the binaries for k3s-arm64 from dist/artifacts/k3s-arm64,

deploy k3s

chmod +x k3s
cp k3s /usr/local/bin/
curl -o install.sh https://get.k3s.io
export INSTALL_K3S_SKIP_DOWNLOAD=true
./install.sh

go version go1.22.2 linux/arm64
k3s tag :v1.30.1+k3s1

Environmental Info:
K3s Version: v1.30.1+k3s1

image

Node(s) CPU architecture, OS, and Version:

Cluster Configuration:

Describe the bug:

Steps To Reproduce:

  • Installed K3s:

Expected behavior:

Actual behavior:

Additional context / logs:

@dereknola
Copy link
Member

dereknola commented Sep 19, 2024

Move your k3s binary to /usr/local/bin and rename it k3s.

Your failures are unrelated to the K3s install script. You need to post the K3s logs, not just the output from kubectl.

@dereknola
Copy link
Member

Also, any reason why you are compiling K3s yourself? We publish arm64 releases.

@brandond
Copy link
Member

It looks like it's starting, but runc is failing to start containers for some reason... what exactly did you change in k3s that caused you to need to rebuild it? I don't see that there's anything wrong with how you're installing or running it, so I suspect you've broken something else.

@RonaldFletcher
Copy link
Author

It looks like it's starting, but runc is failing to start containers for some reason... what exactly did you change in k3s that caused you to need to rebuild it? I don't see that there's anything wrong with how you're installing or running it, so I suspect you've broken something else.

I didn't modify anything,only compile

@brandond
Copy link
Member

... why? Does k3s work properly if you download one of the binaries from our release page? If it does, then the problem is your build. If it does not, then the problem is your node.

@RonaldFletcher
Copy link
Author

My compilation environment dockerfile is as follows

FROM golang:1.22.2-alpine3.18

# Set proxy environment variables
ARG http_proxy
ARG https_proxy
ARG no_proxy
ENV http_proxy=${http_proxy} \
    https_proxy=${https_proxy} \
    no_proxy=${no_proxy}

# Install necessary packages
RUN apk -U --no-cache add \
    bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers \
    zlib-dev tar zip squashfs-tools npm coreutils python3 py3-pip openssl-dev libffi-dev libseccomp \
    libseccomp-dev libseccomp-static make libuv-static sqlite-dev sqlite-static libselinux \
    libselinux-dev zlib-dev zlib-static zstd pigz alpine-sdk binutils-gold btrfs-progs-dev \
    btrfs-progs-static gawk yq \
    && [ "$(go env GOARCH)" = "amd64" ] && apk -U --no-cache add mingw-w64-gcc || true


# Install goimports
RUN GOPROXY=direct go install golang.org/x/tools/cmd/goimports@gopls/v0.11.0



# Install golangci-lint for amd64
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
    curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2;  \
    fi
    
# Set SELINUX environment variable
ARG SELINUX=true
ENV SELINUX=${SELINUX}


WORKDIR /workspace

# 设置容器启动时执行的命令为 bash
CMD ["bash"]

In the container, I cloned the k3s code and executed the command. The compiled k3s-arm cannot be used.

But when I use make k3s's own compilation environment and repeat the previous operation, there is no problem. I don't know why,The sizes of k3s-arm64 compiled by the two are different

@RonaldFletcher
Copy link
Author

@brandond

@brandond
Copy link
Member

I'm sorry, I can't help you debug why your specific build environment doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

3 participants