Skip to navigation Skip to main content

Utilities

  • Subscriptions
  • Downloads
  • Containers
  • Support Cases
Red Hat Customer Portal
  • Subscriptions
  • Downloads
  • Containers
  • Support Cases
  • Products & Services

    Products

    Support

    • Production Support
    • Development Support
    • Product Life Cycles

    Services

    • Consulting
    • Technical Account Management
    • Training & Certifications

    Documentation

    • Red Hat Enterprise Linux
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenStack Platform
    • Red Hat OpenShift Container Platform
    All Documentation

    Ecosystem Catalog

    • Red Hat Partner Ecosystem
    • Partner Resources
  • Tools

    Tools

    • Troubleshoot a product issue
    • Packages
    • Errata

    Customer Portal Labs

    • Configuration
    • Deployment
    • Security
    • Troubleshoot
    All labs

    Red Hat Insights

    Increase visibility into IT operations to detect and resolve technical issues before they impact your business.

    Learn More
    Go to Insights
  • Security

    Red Hat Product Security Center

    Engage with our Red Hat Product Security team, access security updates, and ensure your environments are not exposed to any known security vulnerabilities.

    Product Security Center

    Security Updates

    • Security Advisories
    • Red Hat CVE Database
    • Security Labs

    Keep your systems secure with Red Hat's specialized responses to security vulnerabilities.

    View Responses

    Resources

    • Security Blog
    • Security Measurement
    • Severity Ratings
    • Backporting Policies
    • Product Signing (GPG) Keys
  • Community

    Customer Portal Community

    • Discussions
    • Private Groups
    Community Activity

    Customer Events

    • Red Hat Convergence
    • Red Hat Summit

    Stories

    • Red Hat Subscription Value
    • You Asked. We Acted.
    • Open Source Communities
Or troubleshoot an issue.

Select Your Language

  • English
  • 한국어
  • 日本語
  • 中文 (中国)

Infrastructure and Management

  • Red Hat Enterprise Linux
  • Red Hat Virtualization
  • Red Hat Identity Management
  • Red Hat Directory Server
  • Red Hat Certificate System
  • Red Hat Satellite
  • Red Hat Subscription Management
  • Red Hat Update Infrastructure
  • Red Hat Insights
  • Red Hat Ansible Automation Platform

Cloud Computing

  • Red Hat OpenShift
  • Red Hat CloudForms
  • Red Hat OpenStack Platform
  • Red Hat OpenShift Container Platform
  • Red Hat OpenShift Data Science
  • Red Hat OpenShift Online
  • Red Hat OpenShift Dedicated
  • Red Hat Advanced Cluster Security for Kubernetes
  • Red Hat Advanced Cluster Management for Kubernetes
  • Red Hat Quay
  • OpenShift Dev Spaces
  • Red Hat OpenShift Service on AWS

Storage

  • Red Hat Gluster Storage
  • Red Hat Hyperconverged Infrastructure
  • Red Hat Ceph Storage
  • Red Hat OpenShift Data Foundation

Runtimes

  • Red Hat Runtimes
  • Red Hat JBoss Enterprise Application Platform
  • Red Hat Data Grid
  • Red Hat JBoss Web Server
  • Red Hat Single Sign On
  • Red Hat support for Spring Boot
  • Red Hat build of Node.js
  • Red Hat build of Thorntail
  • Red Hat build of Eclipse Vert.x
  • Red Hat build of OpenJDK
  • Red Hat build of Quarkus

Integration and Automation

  • Red Hat Integration
  • Red Hat Fuse
  • Red Hat AMQ
  • Red Hat 3scale API Management
  • Red Hat JBoss Data Virtualization
  • Red Hat Process Automation
  • Red Hat Process Automation Manager
  • Red Hat Decision Manager
All Products

Table of contents

  1. CLI 工具
  2. 1. OpenShift Container Platform CLI 工具概述
    1. 1.1. CLI 工具列表
  3. 2. OpenShift CLI (oc)
    1. 2.1. OpenShift CLI 入门
      1. 2.1.1. 关于 OpenShift CLI
      2. 2.1.2. 安装 OpenShift CLI
        1. 2.1.2.1. 通过下载二进制文件安装 OpenShift CLI
        2. 2.1.2.2. 使用 Web 控制台安装 OpenShift CLI
          1. 2.1.2.2.1. 使用 Web 控制台在 Linux 上安装 OpenShift CLI
          2. 2.1.2.2.2. 使用 Web 控制台在 Windows 上安装 OpenShift CLI
          3. 2.1.2.2.3. 使用 Web 控制台在 macOS 上安装 OpenShift CLI
        3. 2.1.2.3. 使用 RPM 安装 OpenShift CLI
        4. 2.1.2.4. 使用 Homebrew 安装 OpenShift CLI
      3. 2.1.3. 登录到 OpenShift CLI
      4. 2.1.4. 使用 OpenShift CLI
        1. 2.1.4.1. 创建一个项目
        2. 2.1.4.2. 创建一个新的应用程序
        3. 2.1.4.3. 查看 pod
        4. 2.1.4.4. 查看 pod 日志
        5. 2.1.4.5. 查看当前项目
        6. 2.1.4.6. 查看当前项目的状态
        7. 2.1.4.7. 列出支持的 API 资源
      5. 2.1.5. 获得帮助
      6. 2.1.6. 注销 OpenShift CLI
    2. 2.2. 配置 OpenShift CLI
      1. 2.2.1. 启用 tab 自动完成功能
        1. 2.2.1.1. 为 Bash 启用 tab 自动完成
        2. 2.2.1.2. 为 Zsh 启用 tab 自动完成功能
    3. 2.3. oc 和 kubectl 命令的使用方法
      1. 2.3.1. oc 二进制文件
      2. 2.3.2. kubectl 二进制文件
    4. 2.4. 管理 CLI 配置集
      1. 2.4.1. 关于 CLI 配置集间的切换
      2. 2.4.2. 手动配置 CLI 配置集
      3. 2.4.3. 载入和合并规则
    5. 2.5. 使用插件扩展 OpenShift CLI
      1. 2.5.1. 编写 CLI 插件
      2. 2.5.2. 安装和使用 CLI 插件
    6. 2.6. 使用 Krew 管理 CLI 插件
      1. 2.6.1. 使用 Krew 安装 CLI 插件
      2. 2.6.2. 使用 Krew 更新 CLI 插件
      3. 2.6.3. 使用 Krew 卸载 CLI 插件
      4. 2.6.4. 其它资源
    7. 2.7. OpenShift CLI 开发人员命令参考
      1. 2.7.1. OpenShift CLI(oc)开发人员命令
        1. 2.7.1.1. oc annotate
        2. 2.7.1.2. oc api-resources
        3. 2.7.1.3. oc api-versions
        4. 2.7.1.4. oc apply
        5. 2.7.1.5. oc apply edit-last-applied
        6. 2.7.1.6. oc apply set-last-applied
        7. 2.7.1.7. oc apply view-last-applied
        8. 2.7.1.8. oc attach
        9. 2.7.1.9. oc auth can-i
        10. 2.7.1.10. oc auth reconcile
        11. 2.7.1.11. oc autoscale
        12. 2.7.1.12. oc cancel-build
        13. 2.7.1.13. oc cluster-info
        14. 2.7.1.14. oc cluster-info dump
        15. 2.7.1.15. oc completion
        16. 2.7.1.16. oc config current-context
        17. 2.7.1.17. oc config delete-cluster
        18. 2.7.1.18. oc config delete-context
        19. 2.7.1.19. oc config delete-user
        20. 2.7.1.20. oc config get-clusters
        21. 2.7.1.21. oc config get-contexts
        22. 2.7.1.22. oc config get-users
        23. 2.7.1.23. oc config rename-context
        24. 2.7.1.24. oc config set
        25. 2.7.1.25. oc config set-cluster
        26. 2.7.1.26. oc config set-context
        27. 2.7.1.27. oc config set-credentials
        28. 2.7.1.28. oc config unset
        29. 2.7.1.29. oc config use-context
        30. 2.7.1.30. oc config view
        31. 2.7.1.31. oc cp
        32. 2.7.1.32. oc create
        33. 2.7.1.33. oc create build
        34. 2.7.1.34. oc create clusterresourcequota
        35. 2.7.1.35. oc create clusterrole
        36. 2.7.1.36. oc create clusterrolebinding
        37. 2.7.1.37. oc create configmap
        38. 2.7.1.38. oc create cronjob
        39. 2.7.1.39. oc create deployment
        40. 2.7.1.40. oc create deploymentconfig
        41. 2.7.1.41. oc create identity
        42. 2.7.1.42. oc create imagestream
        43. 2.7.1.43. oc create imagestreamtag
        44. 2.7.1.44. oc create ingress
        45. 2.7.1.45. oc create job
        46. 2.7.1.46. oc create namespace
        47. 2.7.1.47. oc create poddisruptionBudget
        48. 2.7.1.48. oc create priorityclass
        49. 2.7.1.49. oc create quota
        50. 2.7.1.50. oc create role
        51. 2.7.1.51. oc create rolebinding
        52. 2.7.1.52. oc create route edge
        53. 2.7.1.53. oc create route passthrough
        54. 2.7.1.54. oc create route reencrypt
        55. 2.7.1.55. oc create secret docker-registry
        56. 2.7.1.56. oc create secret generic
        57. 2.7.1.57. oc create secret tls
        58. 2.7.1.58. oc create service clusterip
        59. 2.7.1.59. oc create service externalname
        60. 2.7.1.60. oc create service loadbalancer
        61. 2.7.1.61. oc create service nodeport
        62. 2.7.1.62. oc create serviceaccount
        63. 2.7.1.63. oc create token
        64. 2.7.1.64. oc create user
        65. 2.7.1.65. oc create useridentitymapping
        66. 2.7.1.66. oc debug
        67. 2.7.1.67. oc delete
        68. 2.7.1.68. oc describe
        69. 2.7.1.69. oc diff
        70. 2.7.1.70. oc edit
        71. 2.7.1.71. oc exec
        72. 2.7.1.72. oc explain
        73. 2.7.1.73. oc expose
        74. 2.7.1.74. oc extract
        75. 2.7.1.75. oc get
        76. 2.7.1.76. oc idle
        77. 2.7.1.77. oc image append
        78. 2.7.1.78. oc image extract
        79. 2.7.1.79. oc image info
        80. 2.7.1.80. oc image mirror
        81. 2.7.1.81. oc import-image
        82. 2.7.1.82. oc kustomize
        83. 2.7.1.83. oc label
        84. 2.7.1.84. oc login
        85. 2.7.1.85. oc logout
        86. 2.7.1.86. oc logs
        87. 2.7.1.87. oc new-app
        88. 2.7.1.88. oc new-build
        89. 2.7.1.89. oc new-project
        90. 2.7.1.90. oc observe
        91. 2.7.1.91. oc patch
        92. 2.7.1.92. oc plugin list
        93. 2.7.1.93. oc policy add-role-to-user
        94. 2.7.1.94. oc policy scc-review
        95. 2.7.1.95. oc policy scc-subject-review
        96. 2.7.1.96. oc port-forward
        97. 2.7.1.97. oc process
        98. 2.7.1.98. oc project
        99. 2.7.1.99. oc projects
        100. 2.7.1.100. oc proxy
        101. 2.7.1.101. oc registry info
        102. 2.7.1.102. oc registry login
        103. 2.7.1.103. oc replace
        104. 2.7.1.104. oc rollback
        105. 2.7.1.105. oc rollout cancel
        106. 2.7.1.106. oc rollout history
        107. 2.7.1.107. oc rollout latest
        108. 2.7.1.108. oc rollout pause
        109. 2.7.1.109. oc rollout restart
        110. 2.7.1.110. oc rollout resume
        111. 2.7.1.111. oc rollout retry
        112. 2.7.1.112. oc rollout status
        113. 2.7.1.113. oc rollout undo
        114. 2.7.1.114. oc rsh
        115. 2.7.1.115. oc rsync
        116. 2.7.1.116. oc run
        117. 2.7.1.117. oc scale
        118. 2.7.1.118. oc secrets link
        119. 2.7.1.119. oc secrets unlink
        120. 2.7.1.120. oc set build-hook
        121. 2.7.1.121. oc set build-secret
        122. 2.7.1.122. oc set data
        123. 2.7.1.123. oc set deployment-hook
        124. 2.7.1.124. oc set env
        125. 2.7.1.125. oc set image
        126. 2.7.1.126. oc set image-lookup
        127. 2.7.1.127. oc set probe
        128. 2.7.1.128. oc set resources
        129. 2.7.1.129. oc set route-backends
        130. 2.7.1.130. oc set selector
        131. 2.7.1.131. oc set serviceaccount
        132. 2.7.1.132. oc set subject
        133. 2.7.1.133. oc set triggers
        134. 2.7.1.134. oc set volumes
        135. 2.7.1.135. oc start-build
        136. 2.7.1.136. oc status
        137. 2.7.1.137. oc tag
        138. 2.7.1.138. oc version
        139. 2.7.1.139. oc wait
        140. 2.7.1.140. oc whoami
      2. 2.7.2. 其他资源
    8. 2.8. OpenShift CLI 管理员命令参考
      1. 2.8.1. OpenShift CLI(oc)管理员命令
        1. 2.8.1.1. oc adm build-chain
        2. 2.8.1.2. oc adm catalog mirror
        3. 2.8.1.3. oc adm 证书批准
        4. 2.8.1.4. oc adm 证书拒绝
        5. 2.8.1.5. oc adm cordon
        6. 2.8.1.6. oc adm create-bootstrap-project-template
        7. 2.8.1.7. oc adm create-error-template
        8. 2.8.1.8. oc adm create-login-template
        9. 2.8.1.9. oc adm create-provider-selection-template
        10. 2.8.1.10. oc adm drain
        11. 2.8.1.11. oc adm groups add-users
        12. 2.8.1.12. oc adm groups new
        13. 2.8.1.13. oc adm groups prune
        14. 2.8.1.14. oc adm groups remove-users
        15. 2.8.1.15. oc adm groups sync
        16. 2.8.1.16. oc adm inspect
        17. 2.8.1.17. oc adm migrate template-instances
        18. 2.8.1.18. oc adm must-gather
        19. 2.8.1.19. oc adm new-project
        20. 2.8.1.20. oc adm node-logs
        21. 2.8.1.21. oc adm pod-network isolate-projects
        22. 2.8.1.22. oc adm pod-network join-projects
        23. 2.8.1.23. oc adm pod-network make-projects-global
        24. 2.8.1.24. oc adm policy add-role-to-user
        25. 2.8.1.25. oc adm policy add-scc-to-group
        26. 2.8.1.26. oc adm policy add-scc-to-user
        27. 2.8.1.27. oc adm policy scc-review
        28. 2.8.1.28. oc adm policy scc-subject-review
        29. 2.8.1.29. oc adm prune builds
        30. 2.8.1.30. oc adm prune deployments
        31. 2.8.1.31. oc adm prune groups
        32. 2.8.1.32. oc adm prune images
        33. 2.8.1.33. oc adm release extract
        34. 2.8.1.34. oc adm release info
        35. 2.8.1.35. oc adm release mirror
        36. 2.8.1.36. oc adm release new
        37. 2.8.1.37. oc adm taint
        38. 2.8.1.38. oc adm top images
        39. 2.8.1.39. oc adm top imagestreams
        40. 2.8.1.40. oc adm top node
        41. 2.8.1.41. oc adm top pod
        42. 2.8.1.42. oc adm uncordon
        43. 2.8.1.43. oc adm upgrade
        44. 2.8.1.44. oc adm verify-image-signature
      2. 2.8.2. 其他资源
  4. 3. odo 的重要更新
  5. 4. 用于 OpenShift Serverless 的 Knative CLI
    1. 4.1. 主要特性
    2. 4.2. 安装 Knative CLI
  6. 5. Pipelines CLI (tkn)
    1. 5.1. 安装 tkn
      1. 5.1.1. 在 Linux 上安装 Red Hat OpenShift Pipelines CLI
      2. 5.1.2. 使用 RPM 在 Linux 上安装 Red Hat OpenShift Pipelines CLI
      3. 5.1.3. 在 Windows 上安装 Red Hat OpenShift Pipelines CLI
      4. 5.1.4. 在 macOS 上安装 Red Hat OpenShift Pipelines CLI
    2. 5.2. 配置 OpenShift Pipelines tkn CLI
      1. 5.2.1. 启用 tab 自动完成功能
    3. 5.3. OpenShift Pipelines tkn 参考
      1. 5.3.1. 基本语法
      2. 5.3.2. 全局选项
      3. 5.3.3. 工具命令
        1. 5.3.3.1. tkn
        2. 5.3.3.2. completion [shell]
        3. 5.3.3.3. version
      4. 5.3.4. Pipelines 管理命令
        1. 5.3.4.1. pipeline
        2. 5.3.4.2. pipeline delete
        3. 5.3.4.3. pipeline describe
        4. 5.3.4.4. pipeline list
        5. 5.3.4.5. pipeline logs
        6. 5.3.4.6. pipeline start
      5. 5.3.5. pipeline run 命令
        1. 5.3.5.1. pipelinerun
        2. 5.3.5.2. pipelinerun cancel
        3. 5.3.5.3. pipelinerun delete
        4. 5.3.5.4. pipelinerun describe
        5. 5.3.5.5. pipelinerun list
        6. 5.3.5.6. pipelinerun logs
      6. 5.3.6. 任务管理命令
        1. 5.3.6.1. task
        2. 5.3.6.2. task delete
        3. 5.3.6.3. task describe
        4. 5.3.6.4. task list
        5. 5.3.6.5. task logs
        6. 5.3.6.6. task start
      7. 5.3.7. task run 命令
        1. 5.3.7.1. taskrun
        2. 5.3.7.2. taskrun cancel
        3. 5.3.7.3. taskrun delete
        4. 5.3.7.4. taskrun describe
        5. 5.3.7.5. taskrun list
        6. 5.3.7.6. taskrun logs
      8. 5.3.8. 条件管理命令
        1. 5.3.8.1. 条件
        2. 5.3.8.2. 删除条件
        3. 5.3.8.3. condition describe
        4. 5.3.8.4. condition list
      9. 5.3.9. Pipeline 资源管理命令
        1. 5.3.9.1. resource
        2. 5.3.9.2. resource create
        3. 5.3.9.3. resource delete
        4. 5.3.9.4. resource describe
        5. 5.3.9.5. resource list
      10. 5.3.10. ClusterTask 管理命令
        1. 5.3.10.1. clustertask
        2. 5.3.10.2. clustertask delete
        3. 5.3.10.3. clustertask describe
        4. 5.3.10.4. clustertask list
        5. 5.3.10.5. clustertask start
      11. 5.3.11. 触发器管理命令
        1. 5.3.11.1. eventlistener
        2. 5.3.11.2. eventlistener delete
        3. 5.3.11.3. eventlistener describe
        4. 5.3.11.4. eventlistener list
        5. 5.3.11.5. eventListener 日志
        6. 5.3.11.6. triggerbinding
        7. 5.3.11.7. triggerbinding delete
        8. 5.3.11.8. triggerbinding describe
        9. 5.3.11.9. triggerbinding list
        10. 5.3.11.10. triggertemplate
        11. 5.3.11.11. triggertemplate delete
        12. 5.3.11.12. triggertemplate describe
        13. 5.3.11.13. triggertemplate list
        14. 5.3.11.14. clustertriggerbinding
        15. 5.3.11.15. clustertriggerbinding delete
        16. 5.3.11.16. clustertriggerbinding describe
        17. 5.3.11.17. clustertriggerbinding list
      12. 5.3.12. hub 互动命令
        1. 5.3.12.1. hub
        2. 5.3.12.2. hub downgrade
        3. 5.3.12.3. hub get
        4. 5.3.12.4. hub info
        5. 5.3.12.5. hub install
        6. 5.3.12.6. hub reinstall
        7. 5.3.12.7. hub search
        8. 5.3.12.8. hub upgrade
  7. 6. opm CLI
    1. 6.1. 安装 opm CLI
      1. 6.1.1. 关于 opm CLI
      2. 6.1.2. 安装 opm CLI
      3. 6.1.3. 其他资源
    2. 6.2. opm CLI 参考
      1. 6.2.1. generate
        1. 6.2.1.1. dockerfile
      2. 6.2.2. index
        1. 6.2.2.1. add
        2. 6.2.2.2. prune
        3. 6.2.2.3. prune-stranded
        4. 6.2.2.4. rm
      3. 6.2.3. init
      4. 6.2.4. migrate
      5. 6.2.5. render
      6. 6.2.6. serve
      7. 6.2.7. validate
  8. 7. Operator SDK
    1. 7.1. 安装 Operator SDK CLI
      1. 7.1.1. 在 Linux 上安装 Operator SDK CLI
      2. 7.1.2. 在 macOS 上安装 Operator SDK CLI
    2. 7.2. Operator SDK CLI 参考
      1. 7.2.1. bundle
        1. 7.2.1.1. validate
      2. 7.2.2. cleanup
      3. 7.2.3. completion
      4. 7.2.4. create
        1. 7.2.4.1. api
      5. 7.2.5. generate
        1. 7.2.5.1. bundle
        2. 7.2.5.2. kustomize
          1. 7.2.5.2.1. 清单
      6. 7.2.6. init
      7. 7.2.7. run
        1. 7.2.7.1. bundle
        2. 7.2.7.2. bundle-upgrade
      8. 7.2.8. scorecard
  9. 法律通告

4.2. 安装 Knative CLI

请参阅安装 Knative CLI。

  1. Previous
  2. Next
Red Hat

Quick Links

  • Downloads
  • Subscriptions
  • Support Cases
  • Customer Service
  • Product Documentation

Help

  • Contact Us
  • Customer Portal FAQ
  • Log-in Assistance

Site Info

  • Trust Red Hat
  • Browser Support Policy
  • Accessibility
  • Awards and Recognition
  • Colophon

Related Sites

  • redhat.com
  • developers.redhat.com
  • connect.redhat.com
  • cloud.redhat.com

About

  • Red Hat Subscription Value
  • About Red Hat
  • Red Hat Jobs
Copyright © 2023 Red Hat, Inc.
  • Privacy Statement
  • Customer Portal Terms of Use
  • All Policies and Guidelines
Red Hat Summit
Twitter