From a3fdb2fc17a41c0e61f8f155275b9772146b8485 Mon Sep 17 00:00:00 2001 From: Riaan Nolan Date: Fri, 3 Oct 2025 09:11:44 +1000 Subject: [PATCH] Feature: adding a Dev Container to Minikube, enabling us to launch Minikube in a Github Codespace or in a Dev Container locally - adding devcontainer.json file and a section in the README --- .devcontainer/devcontainer.json | 35 +++++++++++++++++++++++++++++++++ .gitignore | 1 + README.md | 9 +++++++++ 3 files changed, 45 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..dfb5eba2d75a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube +// Original file source at: https://github.com/devcontainers/templates/blob/main/src/kubernetes-helm-minikube/.devcontainer/devcontainer.json +{ + "name": "Kubernetes - Minikube-in-Docker", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "enableNonRootDocker": "true", + "moby": "true" + }, + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { + "version": "latest", + "helm": "latest", + "minikube": "latest" + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "kubectl version", + + // Use 'postStartCommand' to run commands after the container is created like starting minikube. + // "postStartCommand": "nohup bash -c 'minikube start && minikube dashboard --url &' > minikube.log && tail -f minikube.log" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 624dcd1a9edf..b64ea93a1827 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ _testmain.go *.test *.prof *.pprof +*.log /deploy/iso/minikube-iso/board/minikube/x86_64/rootfs-overlay/usr/bin/auto-pause /deploy/iso/minikube-iso/board/minikube/aarch64/rootfs-overlay/usr/bin/auto-pause diff --git a/README.md b/README.md index 16496f915af4..41856eb6d6eb 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,15 @@ See the [Getting Started Guide](https://minikube.sigs.k8s.io/docs/start/) :mega: **Please fill out our [fast 5-question survey](https://forms.gle/Gg3hG5ZySw8c1C24A)** so that we can learn how & why you use minikube, and what improvements we should make. Thank you! :dancers: +## Github Codespace + +You can run Minikube in a Gihub Codespace by clicking here: +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/kubernetes/minikube?quickstart=1) + +This will launch a Github Codespace. You can then run `minikube start` and `minikube dashboard` - You can then open Minikube Dashboard by clicking opening the link displayed in the terminal. + +You can also run Minikube in a Dev Container locally using your favourit IDE, for more infor mation see Dev Containers https://code.visualstudio.com/docs/devcontainers/containers + ## Documentation See https://minikube.sigs.k8s.io/docs/