I just received a new MacBook with MacOS Catalina. I used the latest AWS CLI Bundle to install the AWS CLI on the MBP.
`gregory.bonk@greg-bonk-mbp:~/workspace$ unzip awscli-bundle.zip
Archive: awscli-bundle.zip
inflating: awscli-bundle/install
inflating: awscli-bundle/packages/PyYAML-5.2.tar.gz
inflating: awscli-bundle/packages/pyasn1-0.4.8.tar.gz
inflating: awscli-bundle/packages/docutils-0.15.2.tar.gz
inflating: awscli-bundle/packages/botocore-1.14.3.tar.gz
inflating: awscli-bundle/packages/s3transfer-0.3.0.tar.gz
inflating: awscli-bundle/packages/urllib3-1.25.7.tar.gz
inflating: awscli-bundle/packages/python-dateutil-2.8.0.tar.gz
inflating: awscli-bundle/packages/virtualenv-16.7.8.tar.gz
inflating: awscli-bundle/packages/colorama-0.4.1.tar.gz
inflating: awscli-bundle/packages/jmespath-0.9.4.tar.gz
inflating: awscli-bundle/packages/futures-3.3.0.tar.gz
inflating: awscli-bundle/packages/awscli-1.17.3.tar.gz
inflating: awscli-bundle/packages/rsa-3.4.2.tar.gz
inflating: awscli-bundle/packages/six-1.14.0.tar.gz
inflating: awscli-bundle/packages/setup/setuptools_scm-3.3.3.tar.gz
inflating: awscli-bundle/packages/setup/wheel-0.33.6.tar.gz
gregory.bonk@greg-bonk-mbp:~/workspace$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Running cmd: /usr/local/opt/python@2/bin/python2.7 virtualenv.py --no-download --python /usr/local/opt/python@2/bin/python2.7 /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz
Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. wheel-0.33.6.tar.gz
Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-build-isolation --no-cache-dir --no-index --find-links file:///Users/gregory.bonk/workspace/devops-application/infrastructure/awscli-bundle/packages awscli-1.17.3.tar.gz`
Checking the install I see this...
gregory.bonk@greg-bonk-mbp:~/workspace$ which aws
/usr/local/bin/aws
gregory.bonk@greg-bonk-mbp:~/workspace/$ /usr/local/bin/aws --version
aws-cli/1.17.3 Python/2.7.17 Darwin/19.2.0 botocore/1.14.3
Then when running a command to get an EKS cluster configuration...
aws eks update-kubeconfig --name my-eks --region us-west-2
This is the error...
'NoneType' object is not iterable
In the debug I see that there is a response, coming back. Appears to be something with parsing it ?
https://gist.github.com/TechnicalMercenary/48f15680f1fcd506b256e84157f08e30
After deleting my existing _~/.kube/config_ file I ran the update-kubeconfig again and now it works perfectly fine.
Perhaps it was an issue with my config's format or something ? Here's what it used to look like...
$ cat ~/.kube/config
apiVersion: v1
clusters: null
contexts: null
current-context: arn:aws:eks:us-west-2:3456345634:cluster/my-eks
kind: Config
preferences: {}
users: null
I've stumbled upon this again, and I'm going to speculate that the AWS CLI needs to be able to handle config files a little more robustly.
Here's a couple of flows that I've come up with that causes this to fail....
// Start with fresh file
rm ~/.kube/config
// Update with the context you want
aws eks update-kubeconfig --name my-cluster --region us-west-2
// Use KubeCtl to delete the context
kubectl config delete-context arn:aws:eks:us-west-2:000000000000:cluster/my-cluster
// RE-Apply the Config
aws eks update-kubeconfig --name my-cluster --region us-west-2
Tried to insert into contexts, which is a
```apiVersion: v1
clusters:
# Flow 2
// Start with fresh file
rm ~/.kube/config
// Update with the context you want
aws eks update-kubeconfig --name my-cluster --region us-west-2
// Use KubeCtl to delete the context
kubectl config delete-cluster arn:aws:eks:us-west-2:000000000000:cluster/my-cluster
// RE-Apply the Config
aws eks update-kubeconfig --name my-cluster --region us-west-2
'NoneType' object is not iterable
### Config before re-apply
apiVersion: v1
clusters: null
contexts:
Apparently, the AWS CLI will need to take into account the changed behavior, see how the upstream kubernetes issue was closed: https://github.com/kubernetes/kubernetes/issues/88524
thanks all, i had same issue, solved it with rm ~/.kube/config
as well
Thanks for the report and the detailed descriptions on how to get it to fail. I'll confer with the EKS team on how to handle this, as it is a CLI customization.
Most helpful comment
After deleting my existing _~/.kube/config_ file I ran the update-kubeconfig again and now it works perfectly fine.
Perhaps it was an issue with my config's format or something ? Here's what it used to look like...