gpt4 book ai didi

django - Kubernetes不返回端点Django Rest-Framework

转载 作者:行者123 更新时间:2023-12-02 21:14:57 25 4
gpt4 key购买 nike

大家好,我有一个django rest应用程序,每当我使用服务公开部署时,我的minikube都不公开IP,有人知道如何解决它吗?我等待了3个小时,但minikube没有显示任何IP。

容器/容器日志:

<django.db.models.fields.related.ForeignKey>
<django.db.models.fields.TextField>
<django.db.models.fields.related.ForeignKey>
Operations to perform:
Apply all migrations: admin, auth, authtoken, chat, contenttypes, notifications, sessions
Running migrations:
No migrations to apply.
<django.db.models.fields.related.ForeignKey>
<django.db.models.fields.TextField>
<django.db.models.fields.related.ForeignKey>
<django.db.models.fields.related.ForeignKey>
<django.db.models.fields.TextField>
<django.db.models.fields.related.ForeignKey>
Performing system checks...
System check identified no issues (0 silenced).
August 06, 2018 - 19:14:37
Django version 2.0.1, using settings 'chatire.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C

后端服务:
apiVersion: v1
kind: Service
metadata:
name: backend-service
spec:
type: NodePort
ports:
- port: 8000
nodePort: 30001
selector:
service: backend-pod

后端部署:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: backend-deployment
spec:
template:
metadata:
labels:
name: backend-pod
spec:
containers:
- name: container-backend
image: modalgr.azurecr.io/chatbot/backend:v1.1
ports:
- containerPort: 8000
command: ["/bin/sh"]
args: ["app.sh"]
restartPolicy: Always
imagePullSecrets:
- name: azure-auth

错误日志:
C:\Users\Youssef\Documents\kubernetes>minikube service backend-service | findstr IP
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...

最佳答案

错误Waiting, endpoint for service is not ready yet...表示您的服务找不到您的Pod。

发生这种情况是因为“服务”中的标签名称与“部署”中的标签名称不匹配。

若要解决此问题,应在“部署”中将name: backend-pod更改为service: backend-pod

关于django - Kubernetes不返回端点Django Rest-Framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51714470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com