'Access Prodigy UI in Kubernetes Pod

I am attempting to create a service for creating training datasets using the Prodigy UI tool. I would like to do this using a Kubernetes cluster which is running in Azure cloud. My Prodigy UI should be reachable on 0.0.0.0:8880 (on the container).

As such, I created a deployment as follows:

kind: Deployment
  apiVersion: apps/v1beta2
  metadata:
    name: prodigy-dply
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: prodigy_pod
    template:
      metadata:
        labels:
          app: prodigy_pod
      spec:
        containers:
        - name: prodigy-sentiment
          image: bdsdev.azurecr.io/prodigy
          imagePullPolicy: IfNotPresent
          command: ["/bin/bash"]
          args: ["-c", "prodigy spacy textapi -F training_recipe.py"]
          ports:
          - name: prodigyport
            containerPort: 8880

This should (should being the operative word here) expose that 8880 port at the pod level aliased as prodigyport

Following that, I have created a Service as below:

kind: Service
apiVersion: v1
metadata:
  name: prodigy-service
spec:
  type: LoadBalancer
  selector:
    app: prodigy_pod
  ports:
    - protocol: TCP
      port: 8000
      targetPort: prodigyport

At this point, when I run the associated kubectl create -f <deployment>.yaml and kubectl create -f <service>.yaml, I get an ExternalIP and associated Port: 10.*.*.*:34672.

This is not reachable by browser, and I'm assuming I have a misunderstanding of how my browser would interact with this Service, Pod, and the underlying Container. What am I missing here?

Note: I am willing to accept that kubernetes may not be the tool for the job here, it seems enticing because of the ease of scalability and updating images to reflect more recent configurations



Solution 1:[1]

You can find public IP address(LoadBalancer Ingress) with this command:

kubectl get service azure-vote-front

Result like this:

root@k8s-master-79E9CFFD-0:~# kubectl get service azure

NAME               CLUSTER-IP     EXTERNAL-IP      PORT(S)          AGE
azure              10.0.136.182   52.224.219.190   8080:31419/TCP   10m

Then you can browse it with external IP and port, like this:

curl 52.224.219.190:8080

Also you can find the Load Balaner rules via Azure portal: enter image description here

Hope this helps.

Solution 2:[2]

You can find the IP address created for your service by getting the service information through kubectl:

kubectl describe services prodigy-service

The IP address is listed next to LoadBalancer Ingress.

Also, you can use port forwarding to access your pod:

kubectl port-forward <pod_name> 8880:8880

After that you can access Prodigy UI by localhost:8880 in your browser.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jason Ye
Solution 2