How to use custom k3s image #874
-
version=$(curl -s https://update.k3s.io/v1-release/channels | jq -r '.data[]|select(.id=="latest")|.latest')
version=${version/+/-} # v1.22.4-k3s1 FROM rancher/k3s:$version as k3s
FROM alpine:3
RUN apk add --no-cache util-linux udev lvm2 gptfdisk sgdisk
COPY --from=k3s / /
RUN mkdir -p /etc && \
echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "PRETTY_NAME=\"K3s ${version}\"" > /etc/os-release && \
chmod 1777 /tmp
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni
VOLUME /var/log
ENV CRI_CONFIG_FILE="/var/lib/rancher/k3s/agent/etc/crictl.yaml"
ENTRYPOINT ["/bin/k3s"]
CMD ["agent"]
|
Beta Was this translation helpful? Give feedback.
Answered by
iwilltry42
Dec 2, 2021
Replies: 2 comments 8 replies
-
Hi @leelavg , thanks for starting this discussion! |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
leelavg
-
reply moved to #874 (reply in thread) by @iwilltry42 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @leelavg , thanks for starting this discussion!
Can you please provide some logs of the container?
i.e. start the cluster with
k3d cluster create test -a 0 --image=leelavg/k3s:v1.22.4-k3s1 --verbose --no-rollback
and wait for it to fail, then copy the output ofdocker ps -a
anddocker logs k3d-test-server-0