Ready to climb a mountain? In this scenario, you will deploy a small microservices based application that runs on Kubernetes. Two primary topics we will cover are:
- Discovering some efficient ways of bundling a Rust application into a distilled container.
- Discovering how a Node.js applications can communicate through gRPC to a Rust Microservice.
The application consists of two applications. The server application is the model running as a microservice, written in Rust. The client application is a small express web interface. Both applications communicate via gRPC. The UI will present the standard create, read, update, and delete actions (CRUD).
For efficiency, the code has been pre-written, but it's very small and should be easy to dissect and understand.
You will learn how to:
- Write a simple Rust Hello world application
- Write a simple Rust based microservice
- Write a getting started Node.js web application
- Communicate between two applications using gRPC
- Compose a Rust application into a distilled container
- Push a container to a private registry on Kubernetes
- Instruct Kubernetes to start an application
- Access an application service running on Kubernetes
Rust A language empowering everyone to build reliable and efficient software.
Express.js is a fast, unopinionated, minimalist web framework for Node.js.
gRPC is a high-performance, open source universal RPC framework
All of this you will build into containers and run on Kubernetes.
You just climbed a big mountain. You tackled the concepts of building a Rust microservice into a container and connecting it to a web application with gRPC. All of this running on Kubernetes. Enjoy the fresh air at the top.
You can use this scenario as a building block for your next gRPC based microservices. It may not be in Rust, but the same concepts and gRPC API library calls can be applied in a variety of other languages. The distillation patterns we applied can also translate into other language packaging for container images.
If you are concerned about the image size, the startup time, or configuring the memory and CPU then head over to the scenario Distilled JRE Apps in Containers.
With these steps you have learned how to:
- ✔ Write a simple Rust Hello world application
- ✔ Write a simple Rust based microservice
- ✔ Write a getting started Node.js web application
- ✔ Communicate between two applications using gRPC
- ✔ Compose a Rust application into a distilled container
- ✔ Push a container to a private registry on Kubernetes
- ✔ Instruct Kubernetes to start an application
- ✔ Access an application service running on Kubernetes
- Rust A language empowering everyone to build reliable and efficient software.
- Express.js is a fast, unopinionated, minimalist web framework for Node.js.
- gRPC is a high-performance, open source universal RPC framework.
- Tonic A Rust implementation of gRPC.
- Scenario adapted from LogRocket's article
- Distroless containers
- Scatch containers
Rust Apps in Containers on Kubernetes
Your Kubernetes Cluster
For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify it's ready for your use.
kubectl version --short && \
kubectl get componentstatus && \
kubectl get nodes && \
The Helm package manager used for installing applications on Kubernetes is also available.
helm version --short
You can administer your cluster with the
kubectl CLI tool or use the visual Kubernetes Dashboard. Use this script to access the protected Dashboard.