`Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused`
BeginnerTroubleshootingInstall & Upgrade Failures
Answer
Likely causes → Helm found no kubeconfig (it falls back to localhost:8080): KUBECONFIG unset in CI, wrong path, or the file is not readable by the user.
Diagnose →
echo $KUBECONFIG; ls -l ~/.kube/config
kubectl config current-context
helm env | grep KUBE
Fix → Export KUBECONFIG, pass --kubeconfig/--kube-context, or generate it (aws eks update-kubeconfig --name prod --region ap-south-1).
Prevent → CI steps that set up kubeconfig explicitly and verify with kubectl version before Helm runs.
More on Install & Upgrade Failures
`Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress`Beginner`Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: Service "shop-api" in namespace "shop" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "shop"`Advanced`Error: INSTALLATION FAILED: cannot re-use a name that is still in use`Beginner`Error: UPGRADE FAILED: context deadline exceeded`Beginner`Error: UPGRADE FAILED: release shop failed, and has been rolled back due to atomic being set: context deadline exceeded`Intermediate`Error: UPGRADE FAILED: cannot patch "shop-api" with kind Deployment: Deployment.apps "shop-api" is invalid: spec.selector: Invalid value: v1.LabelSelector{...}: field is immutable`Advanced