ambassador 学习四 grpc 处理
实际上都是envoy 的功劳
基本环境安装参考相关文档即可
参考demo
- proto code
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
package helloworld;
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}curl -v -H "x-ambassador-test-allow: probably" http://localhost:32190//qotm/quote/1
- 部署&& 配置(所用官方yaml文件)
---
apiVersion: v1
kind: Service
metadata:
labels:
service: grpc-greet
name: grpc-greet
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v0
kind: Mapping
name: grpc_mapping
grpc: true
prefix: /helloworld.Greeter/
rewrite: /helloworld.Greeter/
service: grpc-greet
spec:
type: ClusterIP
ports:
- port: 80
name: grpc-greet
targetPort: grpc-api
selector:
service: grpc-greet
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: grpc-greet
spec:
replicas: 1
template:
metadata:
labels:
service: grpc-greet
spec:
containers:
- name: grpc-greet
image: enm10k/grpc-hello-world
ports:
- name: grpc-api
containerPort: 9999
env:
- name: PORT
value: "9999"
command:
- greeter_server
restartPolicy: Always
kubectl apply -f demo-grpc.yaml
部署状态
测试
- 测试脚本
docker run -e ADDRESS=10.6.245.140:32190 enm10k/grpc-hello-world greeter_client
测试结果
参考资料
https://www.getambassador.io/user-guide/grpc
https://github.com/rongfengliang/ambassador-learning
ambassador 学习四 grpc 处理的更多相关文章
- TweenMax动画库学习(四)
目录 TweenMax动画库学习(一) TweenMax动画库学习(二) TweenMax动画库学习(三) Tw ...
- SVG 学习<四> 基础API
目录 SVG 学习<一>基础图形及线段 SVG 学习<二>进阶 SVG世界,视野,视窗 stroke属性 svg分组 SVG 学习<三>渐变 SVG 学习<四 ...
- Android JNI学习(四)——JNI的常用方法的中文API
本系列文章如下: Android JNI(一)——NDK与JNI基础 Android JNI学习(二)——实战JNI之“hello world” Android JNI学习(三)——Java与Nati ...
- SCARA——OpenGL入门学习四(颜色)
OpenGL入门学习[四] 本次学习的是颜色的选择.终于要走出黑白的世界了~~ OpenGL支持两种颜色模式:一种是RGBA,一种是颜色索引模式. 无论哪种颜色模式,计算机都必须为每一个像素保存一些数 ...
- ZigBee学习四 无线+UART通信
ZigBee学习四 无线+UART通信 1) 协调器编程 修改coordinator.c文件 byte GenericApp_TransID; // This is the unique messag ...
- (转)SpringMVC学习(四)——Spring、MyBatis和SpringMVC的整合
http://blog.csdn.net/yerenyuan_pku/article/details/72231763 之前我整合了Spring和MyBatis这两个框架,不会的可以看我的文章MyBa ...
- Spring Boot 项目学习 (四) Spring Boot整合Swagger2自动生成API文档
0 引言 在做服务端开发的时候,难免会涉及到API 接口文档的编写,可以经历过手写API 文档的过程,就会发现,一个自动生成API文档可以提高多少的效率. 以下列举几个手写API 文档的痛点: 文档需 ...
- Expression Blend学习四控件
原文:Expression Blend学习四控件 Expression Blend制作自定义按钮 1.从Blend工具箱中添加一个Button,按住shift,将尺寸调整为125*125; 2.右键点 ...
- day 83 Vue学习四之过滤器、钩子函数、路由、全家桶等
Vue学习四之过滤器.钩子函数.路由.全家桶等 本节目录 一 vue过滤器 二 生命周期的钩子函数 三 vue的全家桶 四 xxx 五 xxx 六 xxx 七 xxx 八 xxx 一 Vue的过滤 ...
随机推荐
- laravel 项目部署注意事项
1.'Failed to open stream: Permission denied' error - Laravel Laravel >= 5.4 php artisan cache:cle ...
- springcloud14---zuul
package com.itmuch.cloud.study; import org.springframework.boot.SpringApplication; import org.spring ...
- PowerDesigner教程系列
文章转载至:http://www.cnblogs.com/yxonline/archive/2007/04/09/705479.html PowerDesigner教程系列(一)概念数据模型 目标:本 ...
- MAC nginx代理设置
问题: 10.154.156.83:10081私服不存在了.但是不能改.用nginx代理至maven.xx.cn 增加换回地址: sudo ifconfig lo0 add 10.154.156.83 ...
- FromBottomToTop第十三周项目博客
FromBottomToTop第十三周项目博客 本周项目计划 完成游戏核心算法以及界面相关类和怪物类 项目进展 用户可选择游戏模式,共有20张不同的地图. 炮台的建立和升级. 小怪的路径算法. 参考资 ...
- libcurl开源库在Win7 + VS2012环境下编译、配置详解 以及下载文件并显示下载进度 demo(转载)
转载:http://blog.csdn.net/fengshuiyue/article/details/39530093(基本教程) 转载:https://my.oschina.net/u/14207 ...
- HDU 1166 敌兵布阵(线段树 or 二叉索引树)
http://acm.hdu.edu.cn/showproblem.php?pid=1166 题意:第一行一个整数T,表示有T组数据. 每组数据第一行一个正整数N(N<=50000),表示敌人有 ...
- 51Nod 1503 猪和回文
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1503 思路: 没想到要用DP去解决. 题目是从起点出发走,我们可以从起点 ...
- tp5.1报错 页面错误!请稍后再试
修改框架中convention.php // 应用调试模式 'app_debug' => true, 修改app.php不一定有效.
- Windows服务程序_测试01
1. #include <stdio.h> #include <Windows.h> #include <tchar.h> #include <process ...