Get permanent certificate to access to kubectl

8/18/2021

I have setup a cluster on AWS using kops. I want to connect to the cluster from my local machine.

I have to do cat ~/.kube/config, copy the content and replace it with my local kube config to access to the cluster.

The problem is that it expires after certain amount of time. Is there a way to get permanent access to the cluster?

-- confusedWarrior
kops
kubectl
kubernetes

1 Answer

8/18/2021

Not sure if you can get permanent access to the cluster, but based on official kOps documentation you can just run kops update cluster command with --admin={duration} flag and set expire time to a very big value.

For example - let set it for almost 10 years:

kops update cluster {your-cluster-name} --admin=87599h --yes

Then just copy as usual your config file to the client.

Based on official release notes, to back to the previous behaviour just use value 87600h.

-- Mikolaj S.
Source: StackOverflow