Replies: 1 comment
-
@tongtaott i think you need to use the kubernetes apiserver url to authenticate the deployment request, the url you used is for inference service to send inference requests not for deployment. To authenticate with the Kubernetes API server using cURL, you can use the following methods depending on your cluster configuration: Service Account Token: List Pods in the current namespace: |
Beta Was this translation helpful? Give feedback.
-
I want to deploy kserve service through http request,I'm wondering where could I get the token to authorize my request?
for example:
curl --location --request POST 'http://****:**/kserve-endpoints/api/namespaces/ai/inferenceservices' \ --header 'Content-Type: application/json' \ --header 'Cookie: XSRF-TOKEN=GSGaWm_wpn9u7JYm9viXWvTAmYdM9xtS5t6g-GHXyDY; lang=zh; oAuthLoginInfo=; _xsrf=2|0cec4e54|7da57da2961d8e339fb6d6846cc3ccbe|1679995842; token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODAxNzM2NTUsImlzcyI6Imt1YmVzcGhlcmUiLCJzdWIiOiJhZG1pbiIsInRva2VuX3R5cGUiOiJhY2Nlc3NfdG9rZW4iLCJ1c2VybmFtZSI6ImFkbWluIn0.Xrkpdk6tI5Z6F592HEX8q1cQz4DedcyVj6dmBPrzSwE; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODAxNzM2NTUsImlzcyI6Imt1YmVzcGhlcmUiLCJzdWIiOiJhZG1pbiIsInRva2VuX3R5cGUiOiJyZWZyZXNoX3Rva2VuIiwidXNlcm5hbWUiOiJhZG1pbiJ9.eTGQGUSHS35tunP4f_ajAX1Auztn8gXaM9n3fVaDLrM; authservice_session=MTY4MDgzMTI3N3xOd3dBTkRjM1FrWkVOVE5OTjAxUFZVbFVSMGhXVkZBMFR6TkdOa1pMTkVGS1VscExSa00wUlZSV01rdEpWVVUxTmtOTlMxQkxURUU9fC-A3uzATgGgv8qIp0em6yKk39rpd-EmsauYT4QUXtq1' \ --header 'X-XSRF-TOKEN: GSGaWm_wpn9u7JYm9viXWvTAmYdM9xtS5t6g-GHXyDY' \ --data-raw '{ "apiVersion": "serving.kserve.io/v1beta1", "kind": "InferenceService", "metadata": { "name": "first-inferenceservice", "namespace": "ai" }, "spec": { "predictor": { "serviceAccountName": "default", "pytorch": { "name": "kfserving-container", "resources": { "limits": { "cpu": "1", "memory": "2Gi" }, "requests": { "cpu": "1", "memory": "2Gi" } }, "storageUri": "s3://models/output_model/" } } } }'
Beta Was this translation helpful? Give feedback.
All reactions