grpc-gateway-template

command module
v0.0.0-...-6be14c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 10 Imported by: 0

README

grpc-gateway-template

Namespace demo

Steps to run the Namespace demo

# check out namespace_basic_no_connect branch
git co namespace_basic_no_connect

# Next. This will generate protobuf files
make

# Run code
go run main.go

After running the above, you should see the following:

INFO: 2022/04/20 18:18:47 Serving gRPC on https://0.0.0.0:10000
INFO: 2022/04/20 18:18:47 [core] parsed scheme: "dns"
INFO: 2022/04/20 18:18:47 [core] ccResolverWrapper: sending update to cc: {[{0.0.0.0:10000  <nil> 0 <nil>}] <nil> <nil>}
INFO: 2022/04/20 18:18:47 [core] ClientConn switching balancer to "pick_first"
INFO: 2022/04/20 18:18:47 [core] Channel switches to new LB policy "pick_first"
INFO: 2022/04/20 18:18:47 [core] Subchannel Connectivity change to CONNECTING
INFO: 2022/04/20 18:18:47 [core] Subchannel picks a new address "0.0.0.0:10000" to connect
INFO: 2022/04/20 18:18:47 [core] Channel Connectivity change to CONNECTING
INFO: 2022/04/20 18:18:47 [core] Subchannel Connectivity change to READY
INFO: 2022/04/20 18:18:47 [core] Channel Connectivity change to READY
INFO: 2022/04/20 18:18:47 Serving gRPC-Gateway and OpenAPI Documentation on https://0.0.0.0:11000

You can attach to the http interface https://0.0.0.0:11000

image
gRPC run on 10000
# Need to be in client directory to pick up certs
cd client
go run main.go 
2022/04/20 18:24:21 Create time: seconds:1650479061 nanos:70050683

Loading Cluster

Step 1:

make complete-kind

Step 2:

Test with Nginx

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - name: nginx 
    image: nginx
    ports:
    - containerPort: 80
EOF


Step 3:

LoadBalancer

kubectl expose pod nginx --type=LoadBalancer

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package example is a reverse proxy.
Package example is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL