Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 57 additions & 57 deletions src/kubectl-helm-minikube/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
{
"id": "kubectl-helm-minikube",
"version": "1.2.2",
"name": "Kubectl, Helm, and Minikube",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"none",
"1.23",
"1.22",
"1.21",
"none"
],
"default": "latest",
"description": "Select or enter a Kubernetes version to install"
},
"helm": {
"type": "string",
"proposals": [
"latest",
"none"
],
"default": "latest",
"description": "Select or enter a Helm version to install"
},
"minikube": {
"type": "string",
"proposals": [
"latest",
"none"
],
"default": "latest",
"description": "Select or enter a Minikube version to install"
}
"id": "kubectl-helm-minikube",
"version": "1.3.1",
"name": "Kubectl, Helm, and Minikube",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"none",
"1.23",
"1.22",
"1.21",
"none"
],
"default": "latest",
"description": "Select or enter a Kubernetes version to install"
},
"mounts": [
{
"source": "minikube-config",
"target": "/home/vscode/.minikube",
"type": "volume"
}
],
"customizations": {
"vscode": {
"settings": {
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes kubectl, Helm, optionally minikube, and needed dependencies pre-installed and available on the `PATH`. When configuring Ingress for your Kubernetes cluster, note that by default Kubernetes will bind to a specific interface's IP rather than localhost or all interfaces. This is why you need to use the Kubernetes Node's IP when connecting - even if there's only one Node as in the case of Minikube."
}
]
}
}
"helm": {
"type": "string",
"proposals": [
"latest",
"none"
],
"default": "latest",
"description": "Select or enter a Helm version to install"
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
"minikube": {
"type": "string",
"proposals": [
"latest",
"none"
],
"default": "latest",
"description": "Select or enter a Minikube version to install"
}
},
"mounts": [
{
"source": "minikube-config",
"target": "/home/vscode/.minikube",
"type": "volume"
}
],
"customizations": {
"vscode": {
"settings": {
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes kubectl, Helm, optionally minikube, and needed dependencies pre-installed and available on the `PATH`. When configuring Ingress for your Kubernetes cluster, note that by default Kubernetes will bind to a specific interface's IP rather than localhost or all interfaces. This is why you need to use the Kubernetes Node's IP when connecting - even if there's only one Node as in the case of Minikube."
}
]
}
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
15 changes: 13 additions & 2 deletions src/kubectl-helm-minikube/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ set -e
# Clean up
rm -rf /var/lib/apt/lists/*

# Fallback version when stable.txt cannot be fetched (updated: 2026-02)
KUBECTL_FALLBACK_VERSION="v1.35.1"

KUBECTL_VERSION="${VERSION:-"latest"}"
HELM_VERSION="${HELM:-"latest"}"
MINIKUBE_VERSION="${MINIKUBE:-"latest"}" # latest is also valid
Expand Down Expand Up @@ -164,7 +167,15 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
# Install the kubectl, verify checksum
echo "Downloading kubectl..."
if [ "${KUBECTL_VERSION}" = "latest" ] || [ "${KUBECTL_VERSION}" = "lts" ] || [ "${KUBECTL_VERSION}" = "current" ] || [ "${KUBECTL_VERSION}" = "stable" ]; then
KUBECTL_VERSION="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 https://dl.k8s.io/release/stable.txt 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
if [ -z "${KUBECTL_VERSION}" ]; then
echo "(!) Failed to fetch kubectl stable version from dl.k8s.io, trying alternative URL..."
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 https://storage.googleapis.com/kubernetes-release/release/stable.txt 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
fi
if [ -z "${KUBECTL_VERSION}" ]; then
echo "(!) Failed to fetch kubectl stable version from both URLs. Using fallback version ${KUBECTL_FALLBACK_VERSION}"
KUBECTL_VERSION="${KUBECTL_FALLBACK_VERSION}"
fi
else
find_version_from_git_tags KUBECTL_VERSION https://github.com/kubernetes/kubernetes
fi
Expand All @@ -174,7 +185,7 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
curl -sSL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${architecture}/kubectl"
chmod 0755 /usr/local/bin/kubectl
if [ "$KUBECTL_SHA256" = "automatic" ]; then
KUBECTL_SHA256="$(curl -sSL "https://dl.k8s.io/${KUBECTL_VERSION}/bin/linux/${architecture}/kubectl.sha256")"
KUBECTL_SHA256="$(curl -sSL "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${architecture}/kubectl.sha256")"
fi
([ "${KUBECTL_SHA256}" = "dev-mode" ] || (echo "${KUBECTL_SHA256} */usr/local/bin/kubectl" | sha256sum -c -))
if ! type kubectl > /dev/null 2>&1; then
Expand Down