Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl minikube renew certificate

I'm using kubectl to access the api server on my minikube cluster on ubuntu but when try to use kubectl command I got an error certificate expired:

/home/ayoub# kubectl get pods
Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2021-08-30T14:39:50+01:00 is before 2021-08-30T14:20:10Z

Here's my kubectl config:

/home/ayoub# kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://127.0.0.1:16443
  name: microk8s-cluster
contexts:
- context:
    cluster: microk8s-cluster
    user: admin
  name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
  user:
    token: REDACTED
root@ayoub-Lenovo-ideapad-720S-13IKB:/home/ayoub#    /home/ayoub# kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://127.0.0.1:16443
  name: microk8s-cluster
contexts:
- context:
    cluster: microk8s-cluster
    user: admin
  name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
  user:
    token: REDACTED
root@ayoub-Lenovo-ideapad-720S-13IKB:/home/ayoub#

How I can renew this certificate?

like image 403
e2rabi Avatar asked Oct 29 '25 06:10

e2rabi


1 Answers

minikube delete - deletes the local Kubernetes cluster - worked for me

reference: https://github.com/kubernetes/minikube/issues/10122#issuecomment-758227950

like image 149
Sunil Kumar Avatar answered Oct 31 '25 00:10

Sunil Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!