我无法在 Docker 容器中使用 Python Firebase Admin SDK,特别是在 Google Kubernetes Engine (GKE) 上。同样的容器在Cloud Run上没有问题。我相信问题出在权限上,但我已经陷入困境。任何帮助,将不胜感激!
这是 Flask 应用程序的概要。所有三个路线都可以在 Cloud Run 上运行,前两个路线可以在 GKE 上运行,第三个路线则失败。
# realtime database address
dbAddress = 'https://[projectID].firebaseio.com/'
# initialize the firebase SDK
credentials = None # the service account should provide the credentials
firebase_admin.initialize_app(credentials,{'databaseURL': dbAddress})
@app.route('/')
def hello_world(): # works on cloud run and GKE
print('Hello, World print statement!')
return 'Hello, World!'
@app.route('/simplepost', methods = ['POST'])
def simple_post():# works on cloud run and GKE
content = request.get_json()
return {'results': …
Run Code Online (Sandbox Code Playgroud) firebase google-compute-engine kubernetes google-kubernetes-engine google-cloud-run