Could not get the response on the browser when I have provided external ip and port generated by kubernetes

1/19/2020

I am using Azure Cloud in deploying a simple spring boot microservices app into Kubernetes. I created a docker image for my spring boot microservices and pushed into private Docker container registry using the Docker CLI. I have created the Kubernetes AKS cluster on Azure Cloud and I have done the process as described by Azure Cloud in setting up the deployment and the service.

My yaml files is as follows

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: holding-details
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  minReadySeconds: 5 
  template:
    metadata:
      labels:
        app: holding-details
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
      - name: holding-details
        image: krajapraveenregistry.azurecr.io/holding-details:v1
        ports:
        - containerPort: 80
        resources:
          requests:
            cpu: 250m
          limits:
            cpu: 500m
---
apiVersion: v1
kind: Service
metadata:
  name: holding-details
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: holding-details

When I ran the Kubectl apply -f <yaml file name> I got like below

Deployment is created and Service is created

When I ran kubectl get service watch command, I got like below

NAME              TYPE           CLUSTER-IP    EXTERNAL-IP     PORT(S)        AGE
holding-details   LoadBalancer   10.0.126.95   52.141.219.11   80:30715/TCP   80s

In the browser, when I gave url like: http://52.141.219.11:80/holdings/swagger-ui.html, I did not got any output

And also when I gave url like: http://52.141.219.11:30715/holdings/swagger-ui.html, I did not got any output

-- Raja Praveen Katta
azure
cloud
kubernetes
microservices

0 Answers