kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.38k stars 4.88k forks source link

minikube checks for updates from the releases-v2.json file every time it starts. #19735

Open nirajanpdl opened 3 weeks ago

nirajanpdl commented 3 weeks ago

What Happened?

In air gapped environment minikube is looking for releases-v2.json file "https://storage.googleapis.com/minikube/releases-v2.json": everry time we start minikube.

This issue is seen from minikube v1.33.0. how to fix it in air gapped environment ?

Attach the log file

Running on machine: host Binary: Built with gc go1.22.5 for linux/amd64 Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg I0930 15:57:55.260968 1341420 out.go:345] Setting OutFile to fd 1 ... I0930 15:57:55.261474 1341420 out.go:392] TERM=xterm,COLORTERM=, which probably does not support color I0930 15:57:55.261478 1341420 out.go:358] Setting ErrFile to fd 2... I0930 15:57:55.261483 1341420 out.go:392] TERM=xterm,COLORTERM=, which probably does not support color I0930 15:57:55.261670 1341420 root.go:338] Updating PATH: /home/user/.minikube/bin I0930 15:57:55.262075 1341420 out.go:352] Setting JSON to false I0930 15:57:55.263823 1341420 start.go:129] hostinfo: {"hostname":"host-22-1-4-79","uptime":24780,"bootTime":1727667296,"procs":325,"os":"linux","platform":"ubuntu","platformFamily":"debian","platformVersion":"22.04","kernelVersion":"5.15.0-102-generic","kernelArch":"x86_64","virtualizationSystem":"kvm","virtualizationRole":"guest","hostId":"a63cc7ec-7f02-4eb4-a18a-4529f6bd13fa"} I0930 15:57:55.263894 1341420 start.go:139] virtualization: kvm guest I0930 15:57:55.265418 1341420 out.go:177] minikube v1.34.0 on Ubuntu 22.04 (kvm/amd64) I0930 15:57:55.266084 1341420 notify.go:220] Checking for updates... I0930 15:57:55.266102 1341420 out.go:177] - MINIKUBE_WANTREPORTERRORPROMPT=false W0930 15:57:55.266079 1341420 preload.go:293] Failed to list preload files: open /home/user/.minikube/cache/preloaded-tarball: no such file or directory I0930 15:57:55.266815 1341420 out.go:177] - KUBECONFIG=/home/user/.kube/config I0930 15:57:55.267402 1341420 out.go:177] - MINIKUBE_HOME=/home/user I0930 15:57:55.267949 1341420 out.go:177] - MINIKUBE_WANTUPDATENOTIFICATION=false W0930 15:57:55.268665 1341420 out.go:270] ! Specified Kubernetes version 1.31.1 is newer than the newest supported version: v1.31.0. Use minikube config defaults kubernetes-version for details. W0930 15:57:55.268699 1341420 out.go:270] ! Specified Kubernetes version 1.31.1 not found in Kubernetes version list I0930 15:57:55.269261 1341420 out.go:177] Searching the internet for Kubernetes version... W0930 15:57:55.273332 1341420 notify.go:59] Error getting json from minikube version url: error with http GET for endpoint https://storage.googleapis.com/minikube/releases-v2.json: Get "https://storage.googleapis.com/minikube/releases-v2.json": dial tcp 127.0.0.1:443: connect: connection refused I0930 15:58:25.271440 1341420 out.go:201] W0930 15:58:25.272459 1341420 out.go:270] X Exiting due to K8S_FAIL_CONNECT: error fetching Kubernetes version list from GitHub: Get "https://api.github.com/repos/kubernetes/kubernetes/releases/tags/v1.31.1": dial tcp 140.82.121.6:443: i/o timeout W0930 15:58:25.272495 1341420 out.go:270] W0930 15:58:25.273648 1341420 out.go:293] ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ If the above advice does not help, please let us know: │ │ https://github.com/kubernetes/minikube/issues/new/choose │ │ │ │ * Please run minikube logs --file=logs.txt and attach logs.txt to the GitHub issue. │ │ │

Operating System

Ubuntu

Driver

None

spowelljr commented 3 weeks ago

Hi @nirajanpdl, you should be able to run minikube config set WantUpdateNotification false, however, the logic is incorrectly doing the curl command before checking the config value, so in the current state it will still attempt to make a call, I'll make a PR to correct this.

spowelljr commented 3 weeks ago

Just following up, the call to the releases file is not what's causing your start to fail, it's trying to pull the Kubernetes version list from GitHub is the issue that's causing your start to fail. You should be able to resolve this by using Kubernetes v1.31.0 instead of Kubernetes v1.31.1 and that version wasn't out when we did our last release. Also, have you been following our offline docs? You'll need to have an internet connection at some point to download dependencies, please see: https://minikube.sigs.k8s.io/docs/handbook/offline/

nirajanpdl commented 3 weeks ago

Yes with kubernetes version 1.31.0, we are not facing any issue since minikube v1.34.0 defaults to k8s 1.31.0. But, Our requirement is to use kubernetes version 1.31.1. in air gapped environment.

I observed that when using non default kubernetes version, minikube startup is failing starting from minikube v1.33.0.

Note: when I use minikube v1.31.2 on k8s 1.31.1 it works perfectly in air gapped environment. So the issue is seen after v1.33.0.

spowelljr commented 3 weeks ago

Some Kubernetes version validation that was added is what you're hitting, this should be resolved for offline usage, but in the meantime adding --force to your start command should prevent this validation from failing your start.