官方文档:https://www.getambassador.io/docs/latest/topics/using/intro-mappings/#resources

Ambassador 通过Mapping资源,设置应用程序的映射关系。

mapping与service的映射关系

Required attribute Description
name is a string identifying the Mapping (e.g. in diagnostics)
prefix is the URL prefix identifying your resource
service is the name of the service handling the resource; must include the namespace (e.g. myservice.othernamespace) if the service is in a different namespace than Ambassador

name

其中,name不可以重复,所有的namespace下,都不可以重复。

Ambassador Edge Stack must have one or more mappings defined to provide access to any services at all. The name of the mapping must be unique.  (******)

prefix

url前缀,以下的url可是设置一个prefix :resource1

https://ambassador.example.com/resource1/foo
https://ambassador.example.com/resource1/bar
https://ambassador.example.com/resource1/baz/zing
https://ambassador.example.com/resource1/baz/zung

注意:prefix不能是“/”

如果 prefix=/man

那么它将会匹配下面所有的url

https://ambassador.example.com/man/foo
https://ambassador.example.com/mankind
https://ambassador.example.com/man-it-is/really-hot-today
https://ambassador.example.com/manohmanohman

services

service的定义如下:

[scheme://]service[.namespace][:port]

1. sheme 可以是http或者https,默认是http

2. service是kubernetes service的name

3.namespace指的是应用远行的namespace

4.port是应该向其发送请求的端口,http默认是80。https默认是443

以下这个例子,所有请求到/httpbin/,都会转发到 http://httpbin.org

---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
name: httpbin-mapping
spec:
prefix: /httpbin/
service: http://httpbin.org

Ambassador-04- Mapping 资源的更多相关文章

  1. 04 . kubernetes资源清单YAML入门

    YAML 通过k8s操作yaml配置文件在node上创建资源,yaml配置文件就像船垛,用来操控docker这艘大船 yam是专门用来写配置文件的语言,非常简洁和强大.而实际上使用yaml配置文件创建 ...

  2. Spring MVC配置静态资源和资源包

    Spring MVC配置静态资源和资源包 本例映射:css目录: pom.xml <properties> <spring.version>4.3.5.RELEASE</ ...

  3. 【282】◀▶ arcpy.mapping 常用函数说明

    arcpy.mapping 教程入门 arcpy.mapping 指导原则 按字母顺序排序的 arcpy.mpping 类列表 按字母顺序排序的 arcpy.mpping 函数列表 按字母顺序排序的 ...

  4. 【281】◀▶ arcpy.mapping 常用类说明

    arcpy.mapping 教程入门 arcpy.mapping 指导原则 按字母顺序排序的 arcpy.mpping 类列表 按字母顺序排序的 arcpy.mpping 函数列表 按字母顺序排序的 ...

  5. winXP 系统下ubuntu-12.04 硬盘安装

    目地:实现XP ubuntu双系统,引导可选择. 出处:根查阅网络资料和自己的安装体检,记录如是. 系统版本:windowsXP  SP3   Ubuntu 12.04 工具资源:grup4dos 2 ...

  6. hibernate+mysql的连接池配置

    1:连接池的必知概念    首先,我们还是老套的讲讲连接池的基本概念,概念理解清楚了,我们也知道后面是怎么回事了. 以前我们程序连接数据库的时候,每一次连接数据库都要一个连接,用完后再释放.如果频繁的 ...

  7. Java Hibernate 之连接池详解

    Hibernate支持第三方的连接池,官方推荐的连接池是C3P0,Proxool,以及DBCP.在配置连接池时需要注意的有三点: 一.Apche的DBCP在Hibernate2中受支持,但在Hiber ...

  8. spring boot application.properties 属性详解

    2019年3月21日17:09:59 英文原版: https://docs.spring.io/spring-boot/docs/current/reference/html/common-appli ...

  9. ubuntu代理设置

    很多时候,服务器都没有连接外部互联网的条件,需要利用代理服务器才能够访问外网资源进行软件包的升级: ubuntu修改apt-get的代理可以使用代理进行安装包的升级: ubuntu@ubuntu:~$ ...

随机推荐

  1. 高性能环形队列框架 Disruptor 核心概念

    高性能环形队列框架 Disruptor Disruptor 是英国外汇交易公司LMAX开发的一款高吞吐低延迟内存队列框架,其充分考虑了底层CPU等运行模式来进行数据结构设计 (mechanical s ...

  2. Differences between Stack and Heap

    本文转载自Differences between Stack and Heap Stack vs Heap So far we have seen how to declare basic type ...

  3. 物联网网关开发:基于MQTT消息总线的设计过程(上)

    道哥的第 021 篇原创 目录 一.前言 二.网关的作用 2.1 指令转发 2.2 外网通信 2.3 协议转换 2.4 设备管理 2.5 边沿计算(自动化控制) 三.网关内部进程之间的通信 3.1 网 ...

  4. Python3.x 基础练习题100例(51-60)

    练习51: 题目: 学习使用 按位与(&) . 分析: 0&0=0; 0&1=0; 1&0=0; 1&1=1. 程序: if __name__ == '__ma ...

  5. 后端程序员之路 51、A Tour of Go-1

    # A Tour of Go    - go get golang.org/x/tour/gotour    - https://tour.golang.org/    # welcome    - ...

  6. 使用windbg定位内存问题【入门级】

    1. 背景 在开发过程中,我们可能遇到应用程序线程占用过大的问题,可以通过windbg命令去定位哪些类型,哪些内存一直占用堆资源,从而查出问题,解决问题. 2. 准备工作 工具: 抓取DUMP文件的工 ...

  7. SQL学习笔记——创建数据库显示:文件激活错误,物理文件名不存在>>解决方案

    今天在创建数据库时,跟着老师一步一步的操作创建成功,但出于在厌恶冗长的数据库存储路径,于是,擅自更改了数据filename,让他保存在电脑桌面新建的文件夹,可是一执行就报错了. 老师源码: 1 cre ...

  8. MySQL全面瓦解25:构建高性能索引(案例分析篇)

    回顾一下上面几篇索引相关的文章: MySQL全面瓦解22:索引的介绍和原理分析 MySQL全面瓦解23:MySQL索引实现和使用 MySQL全面瓦解24:构建高性能索引(策略篇) 索引的十大原则 1. ...

  9. Sentinel高级

    Sentinel高级 sentinel和springCloud整合 减少开发的复杂度,对大部分的主流框架,例如:Web Servlet.Dubbo.Spring Cloud.gRPC.Spring W ...

  10. 一起来学习LiteOS中断模块的源代码

    摘要:本文带领大家一起剖析了LiteOS中断模块的源代码. 本文我们来一起学习下LiteOS中断模块的源代码,文中所涉及的源代码,均可以在LiteOS开源站点https://gitee.com/Lit ...