Skip to content

namespace defaults to in-cluster namespace when run with explicit KUBECONFIG #1241

Open
@hojerst

Description

When a KUBECONFIG is set explicitly to a external cluster, the client still defaults to the namespace mounted in /run/secrets/kubernetes.io/serviceaccount. This means the same kubeconfig setting/file will behave differently depending if it is run inside or outside of a cluster.

IMHO this should be changed to default to the default namespace as if run outside of the cluster. Defaulting to the serviceaccount's namespace doesn't really make sense here as the referenced cluster might not even have this namespace and it leads to inconsistent and unexpected behaviour.

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