this example project will use many microservices written in different languages that talk to each other over gRPC.
Find Protocol Buffers Descriptions at the ./pb
directory.
- app_frontend
- app_backend
- api_usr_invite
Service | Language | Description |
---|---|---|
app_frontend | Go | Exposes an HTTP server to serve the frontend website (not implemented yet). |
app_backend | Go | Exposes an HTTP server to serve the backend website (not implemented yet). |
api_usr_invite | Go | Provide a gRPC service the handle user invite codes for our upcoming user registration process |
We offer the following installation methods:
-
Running locally (~20 minutes) You will build and deploy microservices images to a single-node Kubernetes cluster running on your development machine. There are three options to run a Kubernetes cluster locally for this demo:
- Minikube. Recommended for Linux hosts (also supports Mac/Windows).
- Docker for Desktop / Docker Compose. Recommended for Mac/Windows.
- Kind. Supports Mac/Windows/Linux.
-
Running on Google Kubernetes Engine (GKE) (~30 minutes) You will build, upload and deploy the container images to a Kubernetes cluster on Google Cloud.
-
Using pre-built container images: (~10 minutes, you will still need to follow one of the steps above up until
skaffold run
command). With this option, you will use pre-built container images that are available publicly, instead of building them yourself, which takes a long time).
- kubectl (can be installed via
gcloud components install kubectl
) - Local Kubernetes cluster deployment tool:
- Minikube (recommended for Linux)
- Docker for Desktop (recommended for Mac/Windows)
- It provides Kubernetes support as noted here
- Kind
- skaffold (ensure version ≥v1.10)
- Enable GCP APIs for Cloud Monitoring, Tracing, Debugger:
gcloud services enable monitoring.googleapis.com \ cloudtrace.googleapis.com \ clouddebugger.googleapis.com
- Create the ENV files for
sys_mongodb
, and the gRPC serviceapi_user_invite
in the appropriate directories for the ENV files currently provided in this example.cat <<EOT > src/sys_mongodb/.env MONGODB_ROOT_PASSWORD=<your-mongodb-root-pwd> MONGODB_USERNAME=<your-mongodb-col-usr> MONGODB_PASSWORD=<your-mongodb-col-pwd> MONGODB_DATABASE=<your_mongodb_col> EOT
cat <<EOT > src/api_user_invite/.env DISABLE_TRACING=1 DISABLE_PROFILER=1 DISABLE_STATS=0 DISABLE_DEBUG=0 DB_MONGO_USR=<your-mongodb-col-usr> DB_MONGO_PWD=<your-mongodb-col-pwd> DB_MONGO_PDB=<your_mongodb_col> DB_MONGO_LNK=mongodb://api_example_user_mongodb:27017/ PORT=50051 EOT
- Create the gRPC service image file for
api_user_invite
cd src/api_user_invite make image
docker-compose up
- loading fixtures / seeding database
docker container kill --signal USR1 rf-example-grpc-user-invite-code
- activate / deactivate random request latency effect
docker container kill --signal USR2 rf-example-grpc-user-invite-code
- loading fixtures / seeding database
kubectl exec \ $(kubectl get pods -l app=rf-example-grpc-user-invite-code -o jsonpath='{.items[0].metadata.name}') \ -c server -- kill -USR1 1
- activate / deactivate random request latency effect
kubectl exec \ $(kubectl get pods -l app=rf-example-grpc-user-invite-code -o jsonpath='{.items[0].metadata.name}') \ -c server -- kill -USR1 2
See LICENSE for full details.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Copyright © 2019-2020 Patrick Paechnatz / RelicFrog Team