apiVersion: apps/v1
kind: Deployment
metadata:
name: organization-deployment
labels:
app: organization
spec:
selector:
matchLabels:
app: organization
template:
metadata:
labels:
app: organization
spec:
containers:
- name: organization-container
image: test.azurecr.io/organizationservice:latest
ports:
- containerPort: 9080
imagePullSecrets:
- name: guidesecret
# service type loadbalancer
---
apiVersion: v1
kind: Service
metadata:
name: organization-service
spec:
type: LoadBalancer
selector:
app: organization
ports:
- protocol: TCP
port: 9080
targetPort: 9080
这里是我的部署。yaml文件的AKS,但我无法访问pod使用外部ip与端口9080。
有人能建议如何使用外部IP访问pod吗?有人能查看我的部署文件吗?
1条答案
按热度按时间iovurdzv1#
提供的信息似乎不一致。一个服务的类型为
ClusterIP
,另一个服务的类型为LoadBalancer
。最好重新检查您的部署和服务,然后提供有效的详细信息。