kubectl config delete-context

概要 (Synopsis)

從 kubeconfig 刪除指定的 context。(Delete the specified context from the kubeconfig.)

kubectl config delete-context NAME

範例 (Examples)

  # Delete the context for the minikube cluster
  kubectl config delete-context minikube

選項 (Options)

-h, --help

delete-context 的說明 (help for delete-context)

--as string

要模擬操作的使用者名稱。使用者可以是命名空間中的一般使用者或服務帳戶。(Username to impersonate for the operation. User could be a regular user or a service account in a namespace.)

--as-group strings

要模擬操作的群組,可以重複此標誌以指定多個群組。(Group to impersonate for the operation, this flag can be repeated to specify multiple groups.)

--as-uid string

要模擬操作的 UID。(UID to impersonate for the operation.)

--cache-dir string     預設值: "$HOME/.kube/cache" (Default: "$HOME/.kube/cache")

預設快取目錄 (Default cache directory)

--certificate-authority string

憑證授權單位的憑證檔案路徑 (Path to a cert file for the certificate authority)

--client-certificate string

TLS 用戶端憑證檔案路徑 (Path to a client certificate file for TLS)

--client-key string

TLS 用戶端金鑰檔案路徑 (Path to a client key file for TLS)

--cluster string

要使用的 kubeconfig 叢集名稱 (The name of the kubeconfig cluster to use)

--context string

要使用的 kubeconfig context 名稱 (The name of the kubeconfig context to use)

--default-not-ready-toleration-seconds int     預設值: 300 (Default: 300)

指示 tolerationSeconds,用於 notReady:NoExecute 容忍度,預設會新增至每個尚未具有此容忍度的 Pod。(Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration.)

--default-unreachable-toleration-seconds int     預設值: 300 (Default: 300)

指示 tolerationSeconds,用於 unreachable:NoExecute 容忍度,預設會新增至每個尚未具有此容忍度的 Pod。(Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration.)

--disable-compression

如果為 true,則選擇不壓縮伺服器的所有請求的回應 (If true, opt-out of response compression for all requests to the server)

--insecure-skip-tls-verify

如果為 true,則不會檢查伺服器憑證的有效性。這會使您的 HTTPS 連線不安全 (If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure)

--kubeconfig string

使用特定的 kubeconfig 檔案 (use a particular kubeconfig file)

--match-server-version

要求伺服器版本與用戶端版本相符 (Require server version to match client version)

-n, --namespace string

如果存在,則此 CLI 請求的命名空間範圍 (If present, the namespace scope for this CLI request)

--password string

API 伺服器的基本身份驗證密碼 (Password for basic authentication to the API server)

--profile string     預設值: "none" (Default: "none")

要擷取的 profile 名稱。選項之一 (none|cpu|heap|goroutine|threadcreate|block|mutex) (Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex))

--profile-output string     預設值: "profile.pprof" (Default: "profile.pprof")

要寫入 profile 的檔案名稱 (Name of the file to write the profile to)

--request-timeout string     預設值: "0" (Default: "0")

在放棄單一伺服器請求之前等待的時間長度。非零值應包含對應的時間單位(例如 1 秒、2 分、3 小時)。值為零表示請求不會逾時。(The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.)

-s, --server string

Kubernetes API 伺服器的位址和埠 (The address and port of the Kubernetes API server)

--storage-driver-buffer-duration duration     預設值: 1m0s (Default: 1m0s)

儲存驅動程式的寫入操作將會在這個期間內被緩衝,並以單一交易提交到非記憶體後端。

--storage-driver-db 字串     預設值: "cadvisor"

資料庫名稱

--storage-driver-host 字串     預設值: "localhost:8086"

資料庫主機:埠號

--storage-driver-password 字串     預設值: "root"

資料庫密碼

--storage-driver-secure

使用安全連線至資料庫

--storage-driver-table 字串     預設值: "stats"

資料表名稱

--storage-driver-user 字串     預設值: "root"

資料庫使用者名稱

--tls-server-name 字串

用於伺服器憑證驗證的伺服器名稱。如果未提供,則使用用於連線伺服器的主機名稱。

--token 字串

用於向 API 伺服器進行身份驗證的 Bearer 令牌

--user 字串

要使用的 kubeconfig 使用者名稱

--username 字串

用於向 API 伺服器進行基本身份驗證的使用者名稱

--version 版本[=true]

--version, --version=raw 印出版本資訊並退出;--version=vX.Y.Z... 設定回報的版本

--warnings-as-errors

將從伺服器收到的警告視為錯誤,並以非零的結束代碼退出

參見

本頁面為自動產生。

如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。修正可能需要在 Kubernetes 專案的其他地方進行。

最後修改時間:2024 年 8 月 19 日下午 5:14 PST:更新 v1.31 的 kubectl 參考 (59df28c340)