介绍
今天就跟大家聊聊有关Knative快捷操作命令Kn怎么用,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。
Kn是Knative命令行操作客户端。通过Kn可以方便的操作Knative相关的资源。
安装Kn
可以通过官方获取对应的Kn二进制
- <李>
macOS
李> <李> Linux李> <李> Windows
李>
Kn会与kubectl使用同样的配置文件,默认使用$ HOME/ube/配置
服务管理
使用Kn命令可以执行:列表、创建、删除、申请和更新操作Knative服务。
<>强创建服务强>
使用创建命令:
kn服务创建
示例:
使用应用命令:
kn服务应用
示例:
#, Create an initial service with using & # 39; kn service 应用# 39;,,if 从而service has 不是 #,been already 创建 kn service  apply s0 ——image registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 #,Apply 从而,service again which is a no-operation if none of 从而options 改变 kn service  apply s0 ——image registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 #,Add an  environment variable 用your 服务只注意,,that 你have 用always 完全 #,specify all  parameters (contrast 拷贝;用& # 39;kn service 更新# 39;) kn service  apply s0 ——image registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 ——env 目标=knative #,Read 从而,service declaration 得到a 文件 kn service  apply s0 ——filename my-svc.yml
<强>查看服务强>
查询服务列表示例:
kn service 列表 NAME ,,,,,,,,,,, URL ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, LATEST ,,,,,,,,,,,,,,,,,,,, AGE  CONDITIONS ,, READY ,原因 http://helloworld-go.default.example.com  helloworld-go ,,,,, helloworld-go-pyqqz-1 ,, 55 s ,, 3, OK /, 3,,,,,真正的
查询服务详情示例:
kn service describe helloworld-go 名称:,,,,,,helloworld-go 名称空间:违约 年龄:,,,,,,,,14米 URL:,,,,,,,, http://helloworld-go.default.example.com 修正: 100%,才能,@latest (helloworld-go-cvclp-2),[2](9米) ,,,,,,,图片:,;registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:160e4dc8 , (b80 pinned 用032) 条件: OK 才能;TYPE ,,,,,,,,,,,,,,,,,, AGE 原因 + +,才能Ready ,,,,,,,,,,,,,,,,, 9米 + +,才能ConfigurationsReady ,,, 9米 + +,才能RoutesReady ,,,,,,,,,,,, 9米
或者以yaml方式展示详情:
<>之前,美元kn service describe helloworld-go -oyaml apiVersion: serving.knative.dev/v1 :服务 元数据: 注释:才能 ,,,serving.knative.dev/创造者:1041208914252405 - 1041208914252405 ,,,serving.knative.dev/lastModifier: 1041208914252405 - 1041208914252405 null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null