How to use Kubernetes API