Skip to content

cluster upgrade validation fails if eks-a kubeconfig namespace is not 'default' #9903

@swapzero

Description

@swapzero

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:

# 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    <none>          17m   v1.31.9-eks-ca3410b
worker-1   Ready    <none>          17m   v1.31.9-eks-ca3410b
# switch the namespace to something else than default
$ kubens -c
default

$ kubens eksa-system
✔ Active namespace is "eksa-system"

$ kubens -c
eksa-system
# 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions