标签:apply comment 决定 规范 script operator web word https
当前官方已经提供了两种可选的运行模式
对于通用模式,需要依赖一个后端进行状态存储,官方当前建议的是pg
需要依赖kuma-injector ,我们需要在运行的pod中添加注解
kuma.io/sidecar-injection: enabled
kuma-cp 对于在通用模式依赖状态存储,默认是内存,实际上在安装包中的配置文件中我们也可以看到 
对于pg 数据库的配置如下:
KUMA_STORE_TYPE=postgres \
KUMA_STORE_POSTGRES_HOST=localhost \
KUMA_STORE_POSTGRES_PORT=5432 \
KUMA_STORE_POSTGRES_USER=kuma-user \
KUMA_STORE_POSTGRES_PASSWORD=kuma-password \
KUMA_STORE_POSTGRES_DB_NAME=kuma \
kuma-cp run
kubernetes 模式
KUMA_STORE_TYPE=kubernetes kuma-cp run
当kuma-cp 启动之后,需要等待数据面板进行连接以及注册,为了保障数据面板可以正常运行,需要准备两件事情
实际可以参考数据面板实体的规范https://kuma.io/docs/0.1.1/documentation/#dataplane-specification 
当我们需要启动一个新的数据面板的时候,同样需要包含两件事情
echo "type: Dataplane
mesh: default
name: redis-1
networking:
  inbound:
  - interface: 127.0.0.1:9000:6379
    tags:
      service: redis" | kumactl apply -f -
?
KUMA_CONTROL_PLANE_BOOTSTRAP_SERVER_URL=http://control-plane:5682 \
KUMA_DATAPLANE_MESH=default \
KUMA_DATAPLANE_NAME=redis-1 \
kuma-dp run
以下是一个后端服务依赖redis的
echo "type: Dataplane
mesh: default
name: backend-1
networking:
  inbound:
  - interface: 127.0.0.1:8000:80
    tags:
      service: backend
  outbound:
  - interface: :10000
    service: redis" | kumactl apply -f -
?
KUMA_CONTROL_PLANE_BOOTSTRAP_SERVER_URL=http://control-plane:5682 \
KUMA_DATAPLANE_MESH=default \
KUMA_DATAPLANE_NAME=redis-1 \
kuma-dp run
说明:我们需要处理inbound 以及outbound
因为kuma 依赖envoy 通过9901 端口我们可以方便的调试常见问题
为了标示服务的角色,需要注意的是必须包含一个service 的tag
参考格式
type: Dataplane
mesh: default
name: web-01
networking:
  inbound:
  - interface: 127.0.0.1:11011:11012
    tags:
      service: backend
  outbound:
  - interface: :33033
    service: redis
格式说明: 
type: 必须为Dataplane 
mesh: 我们需要关联的数据面板 
name: 数据面板实例的名字,必须唯一 
networking: 配置数据流量的inbound 以及outbound规则 
inbound: 一个数组定义通过数据面板可以暴露的访问地址  
     interface: 决定请求格式 {address}:{dataplane-port}:{service-port} 
     tags:定义服务的角色,必须包含一个serevice 的tag 
outbound: 服务发出的每个传出请求也必须通过DP,此对象指定DP在接受服务的传出请求时必须侦听的端口 
    inerface: 向外部服务访问暴露的端口 
    service: 定义关联的服务
以下是kuma-cp 暴露的端口 
5677: sds 服务的端口 
5678: xds grpc 的端口 
5680: http 服务,返回健康状态 
5681:    http 服务 kumactl 依赖次服务端口 
5682: 提供envoy bootstrap 配置,当数据面板启动的时候
kuma 通过5681提供管理配置 
包含的请求url 
/meshes 
/meshes/{name} 
/meshes/{name}/dataplanes 
/meshes/{name}/dataplanes/{name}
https://kuma.io/docs/0.1.1/documentation/#overview
标签:apply comment 决定 规范 script operator web word https
原文地址:https://www.cnblogs.com/rongfengliang/p/11506184.html