In previous article, we talk about how to deploy our application using docker compose with AWS ElasticBeanstalk. That is great but still has some problems. Imagine that you just want to add server container without affecting others, it is a little bit hard to do if we use previous approach. Thus, we can use kubernetes to fix it. My previous article also talks about the basis of Kubernetes, please check it out.
This is a simple calculator to calculate Fibonacci Sequence. If you do not know or forgot about Fib, please visit here.
When traffic is coming, ingress will help us classify the traffic to client and server end. We use ClusterIP to expose a set of pods to other objects in the cluster.
Go to Kubernetes and install it according to your OS.
After installation, we are able to see the version of Kubernetes using below command:
kubectl version --client
Go to Minikube and install it according to the guidelines with your own OS.
After installation, we are able to check and start Minikube by below command:
Deploy an Application
Go to Github and download my prepared configuration. Or you may:
git clone https://github.com/manbobo2002/node-react-calculator-k8s.git
Then go to the project root directory then deploy it.
kubectl apply -f k8s
You may see a warning about Ingress, that is okay. Then we browse the ip that minikube provided.
Then we are able to see our application.
However, this way is suitable for local only. If we want to go for production, we are recommended to use AWS/GCP/Azure those cloud provider service.