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 docker app image #615

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

willcl-ark
Copy link
Contributor

Ok I think this is better than a flatpak (more cross-platform).

Builds a docker image with:

  • warnet
  • k9s
  • kubectl
  • ktop

...installed.

I set fish as the default shell, as that gets you pretty tab-autocompletion.

All that's needed is to configure ~/.kube/config inside the machine (does warnet auth do this?), and you're good to go.

Current CI is set to build PR branches and pushes to master (tagged as latest), but we can change that if desired.

I will add a test command for it after the image has built in the first run here.

@willcl-ark
Copy link
Contributor Author

Ah, I think perhaps a new workflow from a PR (from a fork) cannot access repo secrets (username and password) causing the login failure?

The run here works, and will allow testing with:

docker run -it will8clark/warnet-app:pr-31

You should configure ~/.kube/config inside the container in the normal way. then you can interact with a cluster as usual.

If you are trying to use a local cluster, then you will need to allow the docker container to talk to (outer) host with --net=host, i.e. by using:

docker run --net=host -it will8clark/warnet-app:pr-31

This will allow the container, when looking up a cluster with an address like 0.0.0.0:42813, to find it on the local cluster. This is probably also possible to set up with specific port forwarding, but you'd need to know the cluster port before starting etc.

@willcl-ark willcl-ark marked this pull request as ready for review September 19, 2024 09:16
@mplsgrant
Copy link
Collaborator

Cool!

This seems to work. I needed to add bash to the Dockerfile because we need that until we move away from kubectl.

I was able to connect to a remote cluster by using a config file. I was also able to connect to my local minikube by copying my minikube data dir to the container.

@willcl-ark
Copy link
Contributor Author

Cool!

This seems to work. I needed to add bash to the Dockerfile because we need that until we move away from kubectl.

I was able to connect to a remote cluster by using a config file. I was also able to connect to my local minikube by copying my minikube data dir to the container.

Thanks for testing. I added bash to the latest image (building now over in https://github.com/willcl-ark/warnet/pull/31/checks...)

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

Successfully merging this pull request may close these issues.

2 participants