@classmethod
def from_env(cls):
    """
        Convenience function to create an instance of KubeConfig from the current environment.

        First tries to use in-cluster ServiceAccount, then tries default ~/.kube/config (or KUBECONFIG)
        """
    try:
        config = cls.from_service_account()
    except FileNotFoundError:
        config = cls.from_file()
    return config
