Downsides to WSL + Rancher Desktop + k8s + AWS

in #bloglast year

That is a lot of tooling. Many probably are not running all of these. If you are on WSL + Rancher and your k8s is an EKS cluster on AWS, then you have probably run into this:

❯ kubectl get namespaces
An error occurred (SignatureDoesNotMatch) when calling the AssumeRole operation: Signature expired: 20221125T214606Z is now earlier than 20221126T042234Z (20221126T043734Z - 15 min.)

An error occurred (SignatureDoesNotMatch) when calling the AssumeRole operation: Signature expired: 20221125T214607Z is now earlier than 20221126T042235Z (20221126T043735Z - 15 min.)

An error occurred (SignatureDoesNotMatch) when calling the AssumeRole operation: Signature expired: 20221125T214608Z is now earlier than 20221126T042236Z (20221126T043736Z - 15 min.)

An error occurred (SignatureDoesNotMatch) when calling the AssumeRole operation: Signature expired: 20221125T214609Z is now earlier than 20221126T042237Z (20221126T043737Z - 15 min.)

An error occurred (SignatureDoesNotMatch) when calling the AssumeRole operation: Signature expired: 20221125T214610Z is now earlier than 20221126T042238Z (20221126T043738Z - 15 min.)
Unable to connect to the server: getting credentials: exec: executable aws failed with exit code 254

Unfortunately, WSL dates are just trash

image.png

date
Fri 25 Nov 2022 02:49:06 PM MST

I have not had the patience to actually dig into what stupidity is causing this. I will just give my solution.

Solution

Whatever k8s VM you are using, the date is taken from the host. WSL is but also isn't a VM. Rather, it is the host. I know, this confused me as well. I thought it should just take its date from Windows (actual host), but that is not how it works. What needs to be done is the date in WSL needs to be updated through ntp. Basically, ntp crashed at some point. I do not know why. It needs to be restarted.

 sudo service ntp restart
[sudo] password for *****:
Stopping NTP server: ntpd.
Starting NTP server: ntpd.

Now you are ready to rock.