Home > Enterprise >  Not able to find out the java application url deployed through helm on a local kubernetes cluster
Not able to find out the java application url deployed through helm on a local kubernetes cluster

Time:07-02

Have deployed an application successfully using helm chart but I am unable to understand which url should I use to access it ..Here is the Nodeport service created by Helm for this web app :

kubectl get svc
NAME                      TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
demo-springboot-demoweb   NodePort   10.101.86.143   <none>        8080:31384/TCP   11m
xxxxxxx@xxxxxxxx5 charts % kubectl describe svc
Name:                     demo-springboot-demoweb
Namespace:                springboot-demoweb
Labels:                   app=springboot-demoweb
                          app.kubernetes.io/managed-by=Helm
                          chart=springboot-demoweb-0.1.0
                          heritage=Helm
                          release=demo
Annotations:              meta.helm.sh/release-name: demo
                          meta.helm.sh/release-namespace: springboot-demoweb
Selector:                 app=springboot-demoweb,release=demo
Type:                     NodePort
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.101.86.143
IPs:                      10.101.86.143
Port:                     nginx  8080/TCP
TargetPort:               8080/TCP
NodePort:                 nginx  31384/TCP
Endpoints:                172.17.0.15:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

CodePudding user response:

You have deployed an application that is exposed using a Service of kind NodePort.

That means that all nodes of the cluster expose the application on the same port - the port number is coordinated.

So you need the ip of one of the nodes to access the cluster. You can use kubectl get nodes -o wide to get the nodes and IP addresses. If it is a local cluster it will be shown as INTERNAL IP.

$ kubectl get nodes -o wide
NAME       STATUS   ROLES                  AGE    VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
minikube   Ready    control-plane,master   155m   v1.23.3   192.168.49.2   <none>        Ubuntu 20.04.2 LTS   5.15.0-37-generic   docker://20.10.12

Use one of the IPs together with your NodePort which is 31384. In my example it would be: http://192.168.49.2:31384

CodePudding user response:

So,a s I am only learning this thing using a self paced course , I was able to follow Thomas's suggestion https://chat.stackoverflow.com/rooms/246100/discussion-between-rohit-and-thomas ) and access the application inside kubernetes shell , does the job for now . Thank you Thomas :)

  • Related