Skip to content

accessing cluster without kube confg #472

@EvgenyKhaliper

Description

@EvgenyKhaliper

Hi, it is possible to access the cluster without kube config file ? If yes, can you please guide me cause i feel lost.

I have kube config file which works perfectly with the client but i need to pass this file along with request as base64 so other microservices in my system will use it to access k8s cluster. Seems like wrong way to do it.

So i've read the token using:
kubectl -n kube-system describe secret default-token-XXXXX

What i've done so far is and it fails due to certificates.

    configuration = Configuration()
    configuration.host = "https://address.of.cluster.com"
    configuration.api_key['authorization'] = "token "

    self.core_api = CoreV1Api(ApiClient(configuration=configuration))

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions