grpc-mesh

module
v0.0.0-...-a4e8d3c Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0

README

istio-grpc

Helpers and samples for using gRPC XDS with Istio. Includes a dependency-free XDS client and server for testing and local dev.

Running proxyless gRPC locally (without Istio injection)


# Must be set - will be created by the istio-grpc/bootstrap library.
GRPC_XDS_BOOTSTRAP=./var/run/xds_bootstrap.json
# Debug
GRPC_GO_LOG_VERBOSITY_LEVEL=99
GRPC_GO_LOG_SEVERITY_LEVEL=info

Sample bootstrap file

{
  "xds_servers": [
    {
      "server_uri": "localhost:14057",
      # supports: insecure, google_default
      "channel_creds": [{"type": "insecure"}],
      "server_features" : ["xds_v3"]
    }
  ],
  "node": {
    "id": "sidecar~127.0.1.1~echo.test~cluster.local",
            "metadata": {
      "INSTANCE_IPS": "127.0.1.1",
              "PILOT_SAN": [
        "istiod.istio-system.svc"
      ],
              "GENERATOR": "grpc",
              "NAMESPACE": "test"
    },
    "localisty": {},
    "UserAgentVersionType": "istiov1"
  },
  "certificate_providers": {
    "default": {
      # credentials/tls/certprovider
      "plugin_name": "file_watcher",
              "config": {
        "certificate_file": "../../../../tests/testdata/certs/default/cert-chain.pem",
                "private_key_file": "../../../../tests/testdata/certs/default/key.pem",
                "ca_certificate_file": "../../../../tests/testdata/certs/default/root-cert.pem",
                "refresh_interval": "900s"
      }
    }
  },
  # Name of the listener resource in the LDS response 
  "server_listener_resource_name_template": "xds.istio.io/grpc/lds/inbound/%s"
}

Node will include:

  • UserAgentName 'gRPC Go'
  • UserAgentVersionTYpe ''
  • ClientFeatures - 'envoy.lb.does_not_support_overprovisioning'
Debugging and tools
  • go install -v github.com/grpc-ecosystem/grpcdebug@latest go install -v github.com/bojand/ghz/cmd/ghz
  • go install -v github.com/bojand/ghz/cmd/ghz-web go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

Components

xdsc

Forked from github.com/howardjohn/pilot-load, which is forked from istio/istio/pkg/adsc.

  • removed the import of envoy protos - just use the minimal protos for gRPC ( they are registered by internal )
  • removed the deps on the istio log package. WIP: use a callback to avoid any logging, it's a library.
uxds

Small in-process XDS server, extracted from internal grpc sources, with few extensions to support multiple clients. For tests and minimal environment.

Bootstrap

Extracted from istio, deps removed - generates the bootstrap file. Can be used instead of using the istio-agent. User must still set the GRPC_XDS_BOOTSTRAP env variable to a writeable file ( doesn't need to exist )

Echo

Extracted from istio repo, the main test app for istio. Echo-min is trimmed down to only grpc and fewer deps. echo-micro is further trimmed down - no deps on istio, only the most minimal code possible for server in diffent variations to evaluate code size impact.

uca

Plugin for IstiodCA, mostly cut&pasted from meshca. Ideally should be merged upstream.

Testing


go test -tags=integ ./tests/integration/pilot/ -v -run TestTraffic/virtualservice/shifting-80/proxyless-grpc

Directories

Path Synopsis
bootstrap module
cas module
cmd
xdsc
// Copyright Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
// Copyright Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
certctl Module
k8stok Module
echo module
echo-micro module
echo-min module
gen
connect-go Module
grpc-go Module
proto Module
proto/go Module
ptrds module
telemetry
logs/zap Module
xdsc module
xdsc-grpc

Jump to

Keyboard shortcuts

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