How to Automate Managing Gateway Servers in K8s Environment (using OpenResty Edge)
OpenResty Edge offers an efficient method for managing gateway servers in Kubernetes environments. Typically, gateway servers require manual approval to join a cluster, which can become annoying in the dynamic environment of Kubernetes. This video introduces how to bind Kubernetes to a gateway cluster through OpenResty Edge’s Web console, enabling automatic approval and joining of nodes.
Bind a Kubernetes to a gateway cluster
If the gateway server is running in Kubernetes, Kubernetes will automatically start a new gateway server if the current one unexpectedly quits. This can be annoying to approve manually. OpenResty Edge can automate this process.
Switch to the Admin console of OpenResty Edge. This is our sample deployment of the console. Every user has her own local deployment.
We can bind a Kubernetes to a gateway cluster so that the gateway server running in this Kubernetes is automatically approved. Go to the “Gateway Clusters” page.
Let’s create a new cluster.
Enter the name of the gateway cluster as “k8s-bind-cluster”.
Enable map to Kubernetes.
Select the Kubernetes Cluster you want to bind.
Click on “Create”.
We can see a new cluster is created successfully. There aren’t any gateway nodes in this cluster right now.
Test the result
On the terminal, we have prepared a yaml file to start the gateway server in Kubernetes.
Run the kubectl apply
command to deploy a resource profile.
As shown, it has been deployed to a Kubernetes cluster.
Run the kubectl get pods -n edge
command, to get information about all Pods in the cluster. We can see that the gateway server has started successfully.
Refresh the table.
Check the number of servers.
The gateway server inside in Kubernetes has been automatically added to this gateway cluster.
What is OpenResty Edge
OpenResty Edge is our all-in-one gateway software for microservices and distributed traffic architectures. It combines traffic management, private CDN construction, API gateway, security, and more to help you easily build, manage, and protect modern applications. OpenResty Edge delivers industry-leading performance and scalability to meet the demanding needs of high concurrency, high load scenarios. It supports scheduling containerized application traffic such as K8s and manages massive domains, making it easy to meet the needs of large websites and complex applications.
If you like this tutorial, please subscribe to this blog site and/or our YouTube channel. Thank you!
About The Author
Yichun Zhang (Github handle: agentzh), is the original creator of the OpenResty® open-source project and the CEO of OpenResty Inc..
Yichun is one of the earliest advocates and leaders of “open-source technology”. He worked at many internationally renowned tech companies, such as Cloudflare, Yahoo!. He is a pioneer of “edge computing”, “dynamic tracing” and “machine coding”, with over 22 years of programming and 16 years of open source experience. Yichun is well-known in the open-source space as the project leader of OpenResty®, adopted by more than 40 million global website domains.
OpenResty Inc., the enterprise software start-up founded by Yichun in 2017, has customers from some of the biggest companies in the world. Its flagship product, OpenResty XRay, is a non-invasive profiling and troubleshooting tool that significantly enhances and utilizes dynamic tracing technology. And its OpenResty Edge product is a powerful distributed traffic management and private CDN software product.
As an avid open-source contributor, Yichun has contributed more than a million lines of code to numerous open-source projects, including Linux kernel, Nginx, LuaJIT, GDB, SystemTap, LLVM, Perl, etc. He has also authored more than 60 open-source software libraries.