def METHOD_NAME(client, context, mode):
    if mode == WebConsoleMode.EXTERNAL.value:
        context["mode"] = k8s.KubectlExternalClient.MODE
        # 外部模式使用固定的admin_token和集群ID
        context["admin_user_token"] = settings.WEB_CONSOLE_EXTERNAL_CLUSTER["API_TOKEN"]
        context["admin_cluster_identifier"] = settings.WEB_CONSOLE_EXTERNAL_CLUSTER["ID"]
        context["admin_server_address"] = "{}/tunnels/clusters/{}".format(
            settings.WEB_CONSOLE_EXTERNAL_CLUSTER["API_HOST"], settings.WEB_CONSOLE_EXTERNAL_CLUSTER["ID"]
        )
    else:
        context["mode"] = k8s.KubectlInternalClient.MODE
        # 内部模式user_token, identifier为当前的集群id
        context["admin_user_token"] = context["user_token"]
        context["admin_cluster_identifier"] = context["identifier"]
        context["admin_server_address"] = context["server_address"]
    return context