kf create-route

姓名

kf create-route - 为主机+路径对创建流量路由规则。

摘要

kf create-route DOMAIN [--hostname HOSTNAME] [--path PATH] [flags]

说明

创建路由可让应用声明要在同一主机/网域/路径组合中接收流量。

没有任何绑定应用(或只有已停止的应用)的路由将返回 404 HTTP 状态代码。

Kf 不会在空间之间强制执行路由唯一性。建议为每个空间提供自己的子网域。

示例

kf create-route example.com --hostname myapp # myapp.example.com
kf create-route --space myspace example.com --hostname myapp # myapp.example.com
kf create-route example.com --hostname myapp --path /mypath # myapp.example.com/mypath
kf create-route --space myspace myapp.example.com # myapp.example.com

# Using SPACE to match 'cf'
kf create-route myspace example.com --hostname myapp # myapp.example.com
kf create-route myspace example.com --hostname myapp --path /mypath # myapp.example.com/mypath

标志

--async

返回之前,请勿等待服务器上的操作完成。

-h, --help

有关 create-route 的帮助

--hostname=string

路由的主机名。

--path=string

路由的网址路径。

继承的标志

这些标志继承自父命令。

--as=string

操作要模拟的用户名。

--as-group=strings

操作要模拟的群组。多次添加此标志可指定多个群组。

--config=string

用于 CLI 请求的 Kf 配置文件的路径。

--kubeconfig=string

用于 CLI 请求的 kubeconfig 文件的路径。

--log-http

将 HTTP 请求记录到标准错误。

--space=string

用于对其运行命令的空间。此标志会替换当前所针对的空间。