this is part 46 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.
And I will cover lot of tools as we move on.
this part was supposed to be an aws or azure lab , but due current situation of my country (big explosion happen due chemical products) and I don't have a visa to activate free account. So I will use an Nginx server instead .
as always all the files used are in my github repo here
if you already have it just pull , if not clone it.
the source code usually hold the same chapter number we are in 046 so app_046 is what we are looking for.
this is the app_046_v1.yml it's an typical deployment it use the google samples hello app. and we have service here of type clusterIp (we can use also NodePort) , this port 8080 is the default port of the hello image and the name of app is myapp-v1 and service myapp-v1 . Same for the v2 (go and take a look). What I care here about is the service because it's going to talk with the ingress.
we can notice it's take a path /v1 and /v2 , and port same as the service , and name same of service name.
as we discuss on the #045 when we expose our app to external ip we need Load balancer or Ingress .
Ingress it's mean different routes to same hosts , example test.app.example and test2.app.example or app.example/test and app.example/test2
every route connect to an web service.
minikube addons enable ingress
kubectl create -f app_046_v1.yml kubectl create -f app_046_v2.yml
kubectl get pods
kubectl create -f app_046_ingress.yml
kubectl get ingress
192.168.99.100 is our local ip , if our azure setup is online we will get a real external ip that we can access any time , anywhere , and you also can access it!
we can see now we can access 2 different apps (microservices) using same ip with different routes !