Secret
apiVersion: v1
import "k8s.io/api/core/v1"
Secret
Secret 保留特定類型的密碼資料。Data 欄位中值的總位元組數必須小於 MaxSecretSize 位元組。
apiVersion: v1
kind: Secret
metadata (ObjectMeta)
標準物件的中繼資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
data (map[string][]byte)
Data 包含密碼資料。每個鍵必須由英數字元、「-」、「_」或「.」組成。密碼資料的序列化形式為 base64 編碼字串,代表此處的任意(可能非字串)資料值。在 https://tools.ietf.org/html/rfc4648#section-4 中描述
immutable (boolean)
Immutable,如果設定為 true,可確保 Secret 中儲存的資料無法更新(只能修改物件中繼資料)。如果未設定為 true,則可以隨時修改此欄位。預設為 nil。
stringData (map[string]string)
stringData 允許以字串形式指定非二進位密碼資料。為了方便起見,它以唯寫輸入欄位形式提供。所有鍵和值都會在寫入時合併到 data 欄位中,覆寫任何現有值。從 API 讀取時,永遠不會輸出 stringData 欄位。
type (string)
用於促進密碼資料的程式化處理。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/configuration/secret/#secret-types
SecretList
SecretList 是 Secret 的清單。
apiVersion: v1
kind: SecretList
metadata (ListMeta)
標準清單中繼資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]Secret), 必需
Items 是密碼物件的清單。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/configuration/secret
操作
get
讀取指定的 Secret
HTTP 請求
GET /api/v1/namespaces/{namespace}/secrets/{name}
參數
回應
200 (Secret):確定
401:未經授權
list
列出或監看 Secret 類型的物件
HTTP 請求
GET /api/v1/namespaces/{namespace}/secrets
參數
namespace (在路徑中):字串,必需
allowWatchBookmarks (在查詢中):布林值
continue (在查詢中):字串
fieldSelector (在查詢中):字串
labelSelector (在查詢中):字串
limit (在查詢中):整數
pretty (在查詢中):字串
resourceVersion (在查詢中):字串
resourceVersionMatch (在查詢中):字串
sendInitialEvents (在查詢中):布林值
timeoutSeconds (在查詢中):整數
watch (在查詢中):布林值
回應
200 (SecretList):確定
401:未經授權
list
列出或監看 Secret 類型的物件
HTTP 請求
GET /api/v1/secrets
參數
allowWatchBookmarks (在查詢中):布林值
continue (在查詢中):字串
fieldSelector (在查詢中):字串
labelSelector (在查詢中):字串
limit (在查詢中):整數
pretty (在查詢中):字串
resourceVersion (在查詢中):字串
resourceVersionMatch (在查詢中):字串
sendInitialEvents (在查詢中):布林值
timeoutSeconds (在查詢中):整數
watch (在查詢中):布林值
回應
200 (SecretList):確定
401:未經授權
create
建立 Secret
HTTP 請求
POST /api/v1/namespaces/{namespace}/secrets
參數
namespace (在路徑中):字串,必需
body: Secret,必需
dryRun (在查詢中):字串
fieldManager (在查詢中):字串
fieldValidation (在查詢中):字串
pretty (在查詢中):字串
回應
200 (Secret):確定
201 (Secret):已建立
202 (Secret):已接受
401:未經授權
update
取代指定的 Secret
HTTP 請求
PUT /api/v1/namespaces/{namespace}/secrets/{name}
參數
name (在路徑中):字串,必需
Secret 的名稱
namespace (在路徑中):字串,必需
body: Secret,必需
dryRun (在查詢中):字串
fieldManager (在查詢中):字串
fieldValidation (在查詢中):字串
pretty (在查詢中):字串
回應
200 (Secret):確定
201 (Secret):已建立
401:未經授權
patch
部分更新指定的 Secret
HTTP 請求
PATCH /api/v1/namespaces/{namespace}/secrets/{name}
參數
name (在路徑中):字串,必需
Secret 的名稱
namespace (在路徑中):字串,必需
body: Patch,必需
dryRun (在查詢中):字串
fieldManager (在查詢中):字串
fieldValidation (在查詢中):字串
force (在查詢中):布林值
pretty (在查詢中):字串
回應
200 (Secret):確定
201 (Secret):已建立
401:未經授權
delete
刪除 Secret
HTTP 請求
DELETE /api/v1/namespaces/{namespace}/secrets/{name}
參數
name (在路徑中):字串,必需
Secret 的名稱
namespace (在路徑中):字串,必需
body: DeleteOptions
dryRun (在查詢中):字串
gracePeriodSeconds (在查詢中):整數
pretty (在查詢中):字串
propagationPolicy (在查詢中):字串
回應
200 (Status):確定
202 (Status):已接受
401:未經授權
deletecollection
刪除 Secret 的集合
HTTP 請求
DELETE /api/v1/namespaces/{namespace}/secrets
參數
namespace (在路徑中):字串,必需
body: DeleteOptions
continue (在查詢中):字串
dryRun (在查詢中):字串
fieldSelector (在查詢中):字串
gracePeriodSeconds (在查詢中):整數
labelSelector (在查詢中):字串
limit (在查詢中):整數
pretty (在查詢中):字串
propagationPolicy (在查詢中):字串
resourceVersion (在查詢中):字串
resourceVersionMatch (在查詢中):字串
sendInitialEvents (在查詢中):布林值
timeoutSeconds (在查詢中):整數
回應
200 (Status):確定
401:未經授權
此頁面為自動產生。
如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。修正可能需要在 Kubernetes 專案的其他地方進行。