kubernetesfabric8

how to use farbric8 connects to connect to the Kubernetes API within a Pod


As we know, fabric can connect Kubernetes via ~/.kube/config file. I am wondering how to use farbric8 connects to connect to the Kubernetes API within a Pod? Is there any fabric8 API/library support it?


Solution

  • I'm from Fabric8 team. Fabric8 Kubernetes Client automatically detects whether it's inside a Pod or outside.

    To end user, the process should be transparent. Just make sure your Pod's ServiceAccount has correct roles assigned to access some api group.

    I had tested this some time ago on a demo project with minikube and it was working okay for me. You can try it out and see if it helps your use case: https://github.com/rohanKanojia/kubernetes-client-inside-pod