Knative快捷操作命令Kn怎么用

  介绍

今天就跟大家聊聊有关Knative快捷操作命令Kn怎么用,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

Kn是Knative命令行操作客户端。通过Kn可以方便的操作Knative相关的资源。

安装Kn

可以通过官方获取对应的Kn二进制

<李>

macOS

<李> Linux

<李> Windows

Kn会与kubectl使用同样的配置文件,默认使用$ HOME/ube/配置

服务管理

使用Kn命令可以执行:列表、创建、删除、申请和更新操作Knative服务。

<>强创建服务

使用创建命令:
kn服务创建
示例:

<>之前,美元kn  service  create  helloworld-go ——env 目标=knative ——image registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56   yuncs.com/knative-sample/helloworld-go:73fbdd56   Creating  service  & # 39; helloworld-go& # 39;,拷贝namespace  & # 39;默认# 39;:   0.116 s 从而才能Route  is  still  working 用reflect 从而latest  desired 规范。   0.216才能s  Configuration “helloworld-go", is  waiting  for  a  Revision 用become 准备好了。   3.075 s 才能……   3.149才能s  Ingress  has  not  yet  been 和解。   3.299 s 才能……   3.762 s  Ready 才能用。   Service  & # 39; helloworld-go& # 39;, created 用latest  revision  & # 39; helloworld-go-pyqqz-1& # 39;, is  available  at  URL:   http://helloworld-go.default.example.com

使用应用命令:
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

Knative快捷操作命令Kn怎么用