<p>We create the cluster using the following command</p>
<pre class="lang-sh prettyprint-override"><code>kops create cluster --node-count=3 --node-size=c5.2xlarge --master-count=3 --master-size=c5.xlarge --zones=eu-west-1a --name=${KOPS_CLUSTER_NAME} --yes
</code></pre>
<p>We are using kops cluster. We export the kubeconfig using this command</p>
<pre class="lang-sh prettyprint-override"><code>$ kops export kubecfg --admin --kubeconfig ~/workspace/kubeconfig --state=s3://YOUR-S3-BUCKET-NAME&quot;
</code></pre>
<p>It works fine for sometime. But after sometime we again start getting the same error as TTL expires for kubeconfig</p>
<pre class="lang-sh prettyprint-override"><code>error: You must be logged in to the server (Unauthorized) kops
</code></pre>
<p>Is there any way we can get rid of this annoying TTL?</p>

codeaprendiz
<p>After going through the <a href="https://kops.sigs.k8s.io/cli/kops_export_kubecfg/" rel="noreferrer">docs</a>, found that we can actually give the validity of the <code>kubeconfig</code> as an argument</p>
<pre class="lang-sh prettyprint-override"><code>$ kops export kubecfg --admin=87600h0m0s --kubeconfig ~/workspace/kubeconfig --state=s3://&lt;bucket-name&gt; --name=&lt;cluster-name&gt;

</code></pre>
