Skip to content

Parameter output = text blocks kubectl from working. #7723

@robinpecha

Description

@robinpecha

Describe the bug

After the last AWS-CLI upgrade, kubectl stopped working when you have parameter output = text in .aws/config

Expected Behavior

$ kubectl get ns
aws eks list-clusters
{
"clusters": [
"cluster-sandbox"
]
}
$ aws eks update-kubeconfig --name cluster-sandbox
Updated context arn:aws:eks:eu-west-2:123456789:cluster/cluster-sandbox in /home/devops/.kube/config
$ kubectl config current-context
arn:aws:eks:eu-west-2:123456789:cluster/cluster-sandbox
$ kubectl get namespace
NAME STATUS AGE
default Active 33d

Current Behavior

$ kubectl get ns
aws eks list-clusters
{
"clusters": [
"cluster-sandbox"
]
}
$ aws eks update-kubeconfig --name cluster-sandbox
Updated context arn:aws:eks:eu-west-2:123456789:cluster/cluster-sandbox in /home/devops/.kube/config
$ kubectl config current-context
arn:aws:eks:eu-west-2:123456789:cluster/cluster-sandbox
$ kubectl get namespace
Unable to connect to the server: getting credentials: decoding stdout: couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:"apiVersion,omitempty""; Kind string "json:"kind,omitempty"" }

Reproduction Steps

Put in your .aws/config value output = text , update your kubeconfig and try to connect there:
$ aws eks update-kubeconfig --name cluster-sandbox
$ kubectl config current-context
$ kubectl get namespace

Possible Solution

Remove any output = text from .aws/config

Additional Information/Context

Versions:
Ubuntu 22.04.2 LTS
Linux 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64
aws-cli/2.11.0 Python/3.11.2 Linux/5.19.0-35-generic exe/x86_64.ubuntu.22 prompt/off
kubectl: Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.2", ... GoVersion:"go1.19.6", ...
Kustomize Version: v4.5.7
Python 3.10.6

CLI version used

2.11

Environment details (OS name and version, etc.)

Ubuntu 22.04

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.eks-kubeconfigp1This is a high priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions