我有一个系统运行 swagger-ui 来测试 REST 查询和 minikube 来管理不同查询服务的容器。现在,当我大摇大摆地执行POST
请求时,它会引发此错误:
"timestamp": "2019-07-10T06:53:47.639+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Failure executing: POST at: https://10.96.0.1/apis/batch/v1/namespaces/default/jobs. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. jobs.batch is forbidden: User \"system:serviceaccount:default:default\" cannot create resource \"jobs\" in API group \"batch\" in the namespace \"default\".",
"path": "/workflows"
}
我曾尝试jobs
在 minikube 仪表板中创建一个名为的角色,但这不起作用。我想我必须定义一个具有某些角色的服务帐户,但我不知道它,因为我对 kubernetes 的域很天真。我的查询服务包括GET,POST,DELETE
。
这是我的POST
查询的样子:
{
"jobs": [
{
"container": {
"args": [
"string"
],
"command": "string",
"image": "ingestion",
"properties": {
"scihub_username": "username",
"scihub_password": "password",
"producttype": "S2MSI2A",
"platformname": "Sentinel-2",
"footprint":"POLYGON((5.8664000 50.3276000,9.4623000 50.3276000,9.4623000 52.5325000,5.8664000 52.5325000,5.8664000 50.3276000))",
"days_back": 7
},
"volumes": [
{
"mountPath": "/out_data",
"name": "workspace"
}
]
},
"jobName": "ingestion"
}
],
"workflowName": "ingestion_and_preprocessing"
}
如何修复此错误以正确执行查询?