Skip to content

Commit a3fdb2f

Browse files
committed
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
1 parent 9ebf9fd commit a3fdb2f

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube
3+
// Original file source at: https://github.com/devcontainers/templates/blob/main/src/kubernetes-helm-minikube/.devcontainer/devcontainer.json
4+
{
5+
"name": "Kubernetes - Minikube-in-Docker",
6+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
7+
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
8+
9+
"features": {
10+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
11+
"enableNonRootDocker": "true",
12+
"moby": "true"
13+
},
14+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
15+
"version": "latest",
16+
"helm": "latest",
17+
"minikube": "latest"
18+
}
19+
},
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": "kubectl version",
26+
27+
// Use 'postStartCommand' to run commands after the container is created like starting minikube.
28+
// "postStartCommand": "nohup bash -c 'minikube start && minikube dashboard --url &' > minikube.log && tail -f minikube.log"
29+
30+
// Configure tool-specific properties.
31+
// "customizations": {},
32+
33+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "root"
35+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ _testmain.go
2626
*.test
2727
*.prof
2828
*.pprof
29+
*.log
2930

3031
/deploy/iso/minikube-iso/board/minikube/x86_64/rootfs-overlay/usr/bin/auto-pause
3132
/deploy/iso/minikube-iso/board/minikube/aarch64/rootfs-overlay/usr/bin/auto-pause

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ See the [Getting Started Guide](https://minikube.sigs.k8s.io/docs/start/)
4646

4747
: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:
4848

49+
## Github Codespace
50+
51+
You can run Minikube in a Gihub Codespace by clicking here:
52+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/kubernetes/minikube?quickstart=1)
53+
54+
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.
55+
56+
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
57+
4958
## Documentation
5059

5160
See https://minikube.sigs.k8s.io/docs/

0 commit comments

Comments
 (0)