0

I have deployed java API in ACR and pushed to Kubernetes. I am able to post the data to the service when I use a proxy. but the same service is not working using exposed endpoint. PFB corresponding Kubernetes YAML file:

apiVersion: apps/v1 kind: Deployment metadata: name: taxservice-deployment labels: app: taxserviceapi spec: replicas: 1 template: metadata: name: taxserviceapi labels: app: taxserviceapi spec: containers: - name: taxserviceapi image : 3poacr.azurecr.io/3potaxservice:latest imagePullPolicy: Always ports: - containerPort: 8080 restartPolicy: Always imagePullSecrets: - name: regcret5 selector: matchLabels: app: taxserviceapi --- apiVersion: v1 kind: Service metadata: name: taxservice-service spec: type: NodePort ports: - port: 80 protocol: TCP targetPort: 8080 selector: app: taxserviceapi externalTrafficPolicy: Local 
2
  • You can't talk to through the NodePort? Commented Sep 24, 2018 at 16:19
  • Did you try "kubectl get service" to obtain the nodeport and use the node:nodeport to access the service. NodePort is usually 3xxxx. Commented Sep 25, 2018 at 20:13

2 Answers 2

3

In your service definition, you need to replace spec.type from NodePort to e.g., LoadBalancer.

See more information here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types

Sign up to request clarification or add additional context in comments.

Comments

0

Change your service type to LoadBalancer. You can then check the exposed port by describing the service:

kubectl describe svc taxservice-service 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.