= Kind NodePort Helper
With a https://kubernetes.io[Kubernetes] cluster using https://kind.sigs.k8s.io/[kind], there is no direct way to access the kubernetes services. With Docker for Mac it becomes even more difficult as the Docker for Mac the docker0
bridge is not exposed.
WARNING: Not for production use
== Pre-requisites
== Start a kind cluster
NOTE: Wait for kind cluster to get started
A successful start will show the following output for kubectl get nodes
== Running the application
You can run your application using:
This will run the application in port 8080
, if you need to change the port and run on 9090
please do run as:
== Deploy Demo App
kubectl create ns demos
kubectl config set-context --current --namespace=demos
Once the application is deployed successfully, check the Kubernetes services to know the NodePort:
== Expose NodePort to localhost
To access the service myapp
using its NodePort from the host, run the following API call(assumes the kind-node-controller application is running on 8080
)
If you do a docker ps
, you will notice a small node-port-controller container named demos-myapp-demos-tcp-8080-32120
will be started.
NOTE: The NodePort 32120
in the above example might vary in your deployment
== Accessing the service
Now to access the service from your local host just do localhost:32120
which should return an response like Aloha b4e860e505b3:1
== Open Issues
This project is still under lots of development, please check the https://github.com/kameshsampath/kind-nodeport-controller/issues[issues] to open new one or check existing ones.
== Powered By
This project is built using Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/.