-
Notifications
You must be signed in to change notification settings - Fork 0
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 k3d dev container #1
Conversation
Comment postStartCommand. Modify kubectl version to updated kubectl version --client=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm, just one comment to address. Maybe something to look in other definitions to see how it is done.
RUN apt-get update && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \ | ||
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "${USERNAME}" "${USE_MOBY}" \ | ||
&& /bin/bash /tmp/library-scripts/kubectl-helm-debian.sh "latest" "latest" "latest" \ | ||
&& mkdir -p /home/${USERNAME}/.k3d \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% that /home
should be hardcoded here. It might be that the user's home dir not to be at /home
. I think it can be configurable on devcontainer.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We followed the same pattern used by kubernetes-helm-minikube.
But using $HOME is better since, it should be set per-user with useradd
or usermod
command.
"runArgs": ["--privileged"], | ||
"mounts": [ | ||
"source=k3d-var-lib-docker,target=/var/lib/docker,type=volume", | ||
"source=k3d-config,target=/home/vscode/.k3d,type=volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here with regards /home/vscode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can use something like "~" or "$USER "?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use ${containerEnv:HOME}
to represent HOME directory inside the container.
Reference: https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_variables-in-devcontainerjson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containerEnv:HOME
/.k3d doesn't work.
But /home/${remoteUser}/.k3d
works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Add a new devcontainer definition for k3d kubernetes cluster.
With this, user will be able to create a new devcontainer which will enable the creation of a local kubernetes cluster (automated or manual).
This PR is based off of kubernetes-helm-minikube dev container.
PR Checklist
README.md
describing the containerREADME.md
test.sh
undertest-project
directoryDoes this introduce a breaking change?
Testing
postStartCommand
postStartCommand
References