cluster upgrade validation fails if eks-a kubeconfig namespace is not 'default'
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
**What happened**:
When using the same kubeconfig as the EKS-A tooling, running `eksctl anywhere upgrade cluster` with a namespace other than 'default' selected causes one of the checks to fail:
```
Error: failed to upgrade cluster: validations failed: getting eksa TinkerbellMachineConfig Error from server (NotFound): tinkerbellmachineconfigs.anywhere.eks.amazonaws.com "eks-a-cp" not found
```
It looks like one of the checks doesn't use `--namespace` in the kubectl command.
**What you expected to happen**:
The checks should pass regardless of the current namespace.
**How to reproduce it (as minimally and precisely as possible)**:
This is easy to reproduce:
```bash
# use the same kubeconfig as EKS-A tooling
export KUBECONFIG=eks-a/eks-a-eks-a-cluster.kubeconfig
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
cplane-0 Ready control-plane 35m v1.31.9-eks-ca3410b
cplane-1 Ready control-plane 31m v1.31.9-eks-ca3410b
cplane-2 Ready control-plane 25m v1.31.9-eks-ca3410b
worker-0 Ready 17m v1.31.9-eks-ca3410b
worker-1 Ready 17m v1.31.9-eks-ca3410b
```
```bash
# switch the namespace to something else than default
$ kubens -c
default
$ kubens eksa-system
✔ Active namespace is "eksa-system"
$ kubens -c
eksa-system
```
```bash
# start an `upgrade cluster` without changing any settings in `cluster.yaml`
eksctl anywhere upgrade cluster --hardware-csv hardware.csv -f cluster.yaml --no-timeouts
```
Performing setup and validations
...
✅ Upgrade cluster worker node group kubernetes version increment
✅ Validate authentication for git provider
❌ Validation failed {"validation": "validate immutable fields", "error": "getting eksa TinkerbellMachineConfig Error from server (NotFound): tinkerbellmachineconfigs.anywhere.eks.amazonaws.com \"eks-a-cp\" not found\n", "remediation": ""}
✅ Validate cluster's eksaVersion matches EKS-Anywhere Version
✅ Validate eksa controller is not paused
---
This simple fix would be helpful if you want to build an automation around `eksctl anywhere`.
---
**EKS Anywhere Release**
```
$ eksctl anywhere version
Version: v0.22.6
Release Manifest URL: https://anywhere-assets.eks.amazonaws.com/releases/eks-a/manifest.yaml
Bundle Manifest URL: https://anywhere-assets.eks.amazonaws.com/releases/bundles/100/manifest.yaml
```
Contributor guide
Research direction
Reproduce the failure with `eksctl anywhere upgrade cluster` while the kubeconfig namespace is `eksa-system`, then trace the immutable-fields validation and the kubectl command it invokes. Done means the upgrade validations pass with a non-default current namespace; the issue names no source files or tests to start from.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100