Skip to content

gRPC Python client/server for Testing Kubernetes using NGINX Ingress

Notifications You must be signed in to change notification settings

kent-williams/grpc-python-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-python-kubernetes

This is a python3 gRPC service/client for testing gRPC services inside a Kubernetes cluster using NGINX ingress. It consist of a single service that responds with a UUID that is randomly generated at creation. The unique UUID response is useful for indicating that the responses are coming back from different instances of the service. Development was done on Ubuntu 18.04.

Run Docker Image

sudo docker run --rm -p 50051:50051 --name grpc-python-service k3nt/grpc-python-service

Deploy Kubernetes Cluster with NGINX Ingress

**Important You will need to change the host in gpd-ing.yaml with a domain that points to your ingress controller.

kubectl create -f gpd-dep.yaml
kubectl create -f gpd-svc.yaml
kubectl create -f gpd-ing.yaml

TLS Ingress Rule for SSL

TLS Cert Instructions

After you have created the SSL certificate and created the Kubernetes secret, you must create a .pem file for the client to use.

Concatenat TLS cert & key into pem

cat tls.crt tls.key > tls.pem

Generate gRPC Code

python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. getid.proto

About

gRPC Python client/server for Testing Kubernetes using NGINX Ingress

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages