Ana içeriğe atla

NodePort with istio to entry point for service mash

most emerging tech subjects nowadays are cloud technologies. one of them in containerization area is obviously Kubernetes, I love kubernetes. if you are not using this thing in prod yet even test still very interesting to work in spare times. its really fun. like a world inside a one operation system which is inside a vm that running my local computer. even windows, since my current project requires windows, even window, yes windows :) suppose that you are a developer and writing small capital projects to your friends or runinng POCs. depend on the approach you would need many vms or many containers inside a container orchestrator lets say kubernetes :) for those seperate projects. my choice would be containers definitely. but then I need to remember many port for many entry points. how about making one port you edge point to your service mesh and implement your applications as microservices and deploy them in this mesh and only change the context path. ones you set up a system like this, you without understanding open the door in a very big ecosystem. microservices, kubernetes, devops, containers, istio etc.. below receipt is deploying and configuring one application to mesh and open this application behind a load balancer. and you do not need to pay a fee for balancing :) first we need to create kubernetes deployment (or another suitable)resource for which will be the ingress controller, lets name it istio-ingressgateway. below is the snip part of it as for all deployment type resources, port are not important here as they are internal to your cluster. then we need to create a Gateway component which is actually a loadbalancer like below important part here is label "istio: ingressgateway". this is same as one of above Deployment resource labels. its saying istio-ingressgateway Deployment resource to listen on port 14000 as loadbalancer. at this point istio ingress do not know where to route these incoming(ingress) traffic. lets see if the Deployment open up the related pod first lets get the pod name then connect thru exec as can be seen, port 14000 is aware and listening request. no worries. at this point VirtualService come into picture. its configures loadbalancer to route which traffic to which target. it could be internal or external mesh endpoint. important point in this receipt is guestbook-gateway. its saying which gateway(loadbalancer) to configure. in our case, its configuring above one. so we need a guestbook service. now internally istio-ingressgateway is listenin port 14000 as loadbalancer and routes traffic to endpoint depend on rules in virtialService. the magic part here is if you open this 14000 port as NodePort it will be the entry point for your service-mesh which you can use trail kubernetes cluster. like IBM Bluemix is only offer Kubernetes Ingress controller in standard offer and with more then 2 or more worker nodes. this is a good way to start exposing you mesh with a since entry point. and you can extend your mesh like below, details are self-explaining .. like can be seen easily, with this approach there are many beneficial tools&methods are available. like A/B testing, canary testing, Fault injection since you employ Istio in your environment.

Yorumlar