我正在将Java服务从VSTS部署到Docker,然后再部署到Kubernetes。我能够从ACR成功推送并运行图像。进入Kubernetes后,我无法从Kubernetes浏览该服务。
apiVersion: apps/v1
kind : Deployment
metadata :
name: xservice
labels:
app: xserviceapi
spec:
template:
metadata:
labels:
app: xserviceapi
type : Back-end
spec:
containers:
- name: xservice
image : acr.azurecr.io/xservice:latest
imagePullPolicy: Always
ports:
- containerPort: 80
imagePullSecrets:
- name: regcre
replicas: 1
selector:
matchLabels:
app: xserviceapi
---
apiVersion: v1
kind: Service
metadata:
name: xservice
spec:
type: LoadBalancer
ports:
- port: 80
selector:
app: xserviceapi
答案 0 :(得分:0)
如@OnurYartaşi所述,您应该可以使用40.68.134.174 IP地址来访问服务。