microsoft / pai

Resource scheduling and cluster management for AI

Home Page:https://openpai.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can not use curl to access api, it returns"UnauthorizedUserError"

jdl3000 opened this issue · comments

commented

OpenPAI Environment: kubernetes

  • OpenPAI version: V1.7.0
    my k8s environment is below:
    image

after I deployed opnepai in k8s, I want to set PVC storage for VC,so I use curl to access the api, the token for admin user is from dashboard, it turns out below:

image
and if i use admin user and it's password,it turns out below:
image

anybody knows how to deal with it please help me ,If I did not give some useful message ,you can contact me , I will continue focus on this

image

Please make sure you are admin user. You can get the token under Application->Cookies. And the admin field should be true

commented

finall I figure out it,here is the solution below

  1. find the rest-server service port
    kubectl describe pods rest-server-ds-rvqlk
    image
  2. curl the api server with the port number

curl -X PUT 192.168.13.160:9186/api/v2/groups -H "Authorization: Bearer " -H "content-type: application/json" -d @storage.json