pal*_*taa 1 kubernetes kubernetes-custom-resources vault
作为示例获取架构的方法,secretproviderclasses.secrets-store.csi.x-k8s.io我将使用命令kubectl describe crd secretproviderclasses.secrets-store.csi.x-k8s.io并得到结果:
Name: secretproviderclasses.secrets-store.csi.x-k8s.io
Namespace:
Labels: <none>
Annotations: controller-gen.kubebuilder.io/version: v0.9.0
helm.sh/resource-policy: keep
API Version: apiextensions.k8s.io/v1
Kind: CustomResourceDefinition
Metadata:
Creation Timestamp: 2022-10-11T15:27:15Z
Generation: 1
Managed Fields:
API Version: apiextensions.k8s.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.:
f:controller-gen.kubebuilder.io/version:
f:spec:
f:conversion:
.:
f:strategy:
f:group:
f:names:
f:kind:
f:listKind:
f:plural:
f:singular:
f:scope:
f:versions:
Manager: helm
Operation: Update
Time: 2022-10-11T15:27:15Z
API Version: apiextensions.k8s.io/v1
Fields Type: FieldsV1
fieldsV1:
f:status:
f:acceptedNames:
f:kind:
f:listKind:
f:plural:
f:singular:
f:conditions:
k:{"type":"Established"}:
.:
f:lastTransitionTime:
f:message:
f:reason:
f:status:
f:type:
k:{"type":"NamesAccepted"}:
.:
f:lastTransitionTime:
f:message:
f:reason:
f:status:
f:type:
Manager: kube-apiserver
Operation: Update
Subresource: status
Time: 2022-10-11T15:27:15Z
API Version: apiextensions.k8s.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:kubectl.kubernetes.io/last-applied-configuration:
Manager: kubectl-client-side-apply
Operation: Update
Time: 2022-10-11T15:27:38Z
API Version: apiextensions.k8s.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:helm.sh/resource-policy:
Manager: kubectl-patch
Operation: Update
Time: 2022-10-12T16:02:53Z
Resource Version: 123907610
UID: 4a251e0a-97fc-4369-903f-9aa9a13469c1
Spec:
Conversion:
Strategy: None
Group: secrets-store.csi.x-k8s.io
Names:
Kind: SecretProviderClass
List Kind: SecretProviderClassList
Plural: secretproviderclasses
Singular: secretproviderclass
Scope: Namespaced
Versions:
Name: v1
Schema:
openAPIV3Schema:
Description: SecretProviderClass is the Schema for the secretproviderclasses API
Properties:
API Version:
Description: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Type: string
Kind:
Description: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Type: string
Metadata:
Type: object
Spec:
Description: SecretProviderClassSpec defines the desired state of SecretProviderClass
Properties:
Parameters:
Additional Properties:
Type: string
Description: Configuration for specific provider
Type: object
Provider:
Description: Configuration for provider name
Type: string
Secret Objects:
Items:
Description: SecretObject defines the desired state of synced K8s secret objects
Properties:
Annotations:
Additional Properties:
Type: string
Description: annotations of k8s secret object
Type: object
Data:
Items:
Description: SecretObjectData defines the desired state of synced K8s secret object data
Properties:
Key:
Description: data field to populate
Type: string
Object Name:
Description: name of the object to sync
Type: string
Type: object
Type: array
Labels:
Additional Properties:
Type: string
Description: labels of K8s secret object
Type: object
Secret Name:
Description: name of the K8s secret object
Type: string
Type:
Description: type of K8s secret object
Type: string
Type: object
Type: array
Type: object
Status:
Description: SecretProviderClassStatus defines the observed state of SecretProviderClass
Properties:
By Pod:
Items:
Description: ByPodStatus defines the state of SecretProviderClass as seen by an individual controller
Properties:
Id:
Description: id of the pod that wrote the status
Type: string
Namespace:
Description: namespace of the pod that wrote the status
Type: string
Type: object
Type: array
Type: object
Type: object
Served: true
Storage: true
Deprecated: true
Deprecation Warning: secrets-store.csi.x-k8s.io/v1alpha1 is deprecated. Use secrets-store.csi.x-k8s.io/v1 instead.
Name: v1alpha1
Schema:
openAPIV3Schema:
Description: SecretProviderClass is the Schema for the secretproviderclasses API
Properties:
API Version:
Description: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Type: string
Kind:
Description: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Type: string
Metadata:
Type: object
Spec:
Description: SecretProviderClassSpec defines the desired state of SecretProviderClass
Properties:
Parameters:
Additional Properties:
Type: string
Description: Configuration for specific provider
Type: object
Provider:
Description: Configuration for provider name
Type: string
Secret Objects:
Items:
Description: SecretObject defines the desired state of synced K8s secret objects
Properties:
Annotations:
Additional Properties:
Type: string
Description: annotations of k8s secret object
Type: object
Data:
Items:
Description: SecretObjectData defines the desired state of synced K8s secret object data
Properties:
Key:
Description: data field to populate
Type: string
Object Name:
Description: name of the object to sync
Type: string
Type: object
Type: array
Labels:
Additional Properties:
Type: string
Description: labels of K8s secret object
Type: object
Secret Name:
Description: name of the K8s secret object
Type: string
Type:
Description: type of K8s secret object
Type: string
Type: object
Type: array
Type: object
Status:
Description: SecretProviderClassStatus defines the observed state of SecretProviderClass
Properties:
By Pod:
Items:
Description: ByPodStatus defines the state of SecretProviderClass as seen by an individual controller
Properties:
Id:
Description: id of the pod that wrote the status
Type: string
Namespace:
Description: namespace of the pod that wrote the status
Type: string
Type: object
Type: array
Type: object
Type: object
Served: true
Storage: false
Status:
Accepted Names:
Kind: SecretProviderClass
List Kind: SecretProviderClassList
Plural: secretproviderclasses
Singular: secretproviderclass
Conditions:
Last Transition Time: 2022-10-11T15:27:15Z
Message: no conflicts found
Reason: NoConflicts
Status: True
Type: NamesAccepted
Last Transition Time: 2022-10-11T15:27:15Z
Message: the initial names have been accepted
Reason: InitialNamesAccepted
Status: True
Type: Established
Stored Versions:
v1
Run Code Online (Sandbox Code Playgroud)
活动:
这确实很冗长且难以阅读,那么是否有一些命令可以返回带有示例的 json 模式?
我不知道什么会直接返回给你一个例子。但您可以用来kubectl explain获取有关 api-resources 架构字段的信息:
例如
$ kubectl explain secretproviderclasses.secrets-store.csi.x-k8s.io
Run Code Online (Sandbox Code Playgroud)
要获取以递归方式列出的字段,请使用:
kubectl explain secretproviderclasses.secrets-store.csi.x-k8s.io --recursive
Run Code Online (Sandbox Code Playgroud)
alm-examples一些运营商还在其 ClusterServiceVersion 注释中提供了其提供的 CRD 示例。所以也许这对你来说可能是另一种方式。
| 归档时间: |
|
| 查看次数: |
2926 次 |
| 最近记录: |