0

I'm trying to execute:

microk8s kubectl apply -f  deployment.yaml 

and I am always getting:

error: string field contains invalid UTF-8

No matter which file and string as a file path parameter I'm trying to use. Even if I execute:

microk8s kubectl apply -f  blablabla

Result is the same.


UPD: I resolved the problem by restarting microk8s service. After restart everything is fine, but I still have no idea what it was.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37

2 Answers2

2

This is not a wrong format in the manifest, instead, it's a corrupted cache in $HOME/.kube/

try to delete the cache:

rm -rf $HOME/.kube/http-cache

rm -rf $HOME/.kube/cache

Mahmoud
  • 21
  • 2
1

I have posted Community Wiki answer for better visibility.

As OP has mentioned in the question, he resolved the problem by restarting microk8s service:

I resolved the problem by restarting microk8s service. After restart everything is fine.

Mikołaj Głodziak
  • 4,775
  • 7
  • 28