k8s crds
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s crds相关的知识,希望对你有一定的参考价值。
[root@cloud crds]# cat model.yaml apiVersion: devices.kubeedge.io/v1alpha2 kind: DeviceModel metadata: name: temperature-model-simulate namespace: default spec: properties: - name: temperature-status description: Temperature collected from the edge device type: string: accessMode: ReadOnly defaultValue: \'\'
[root@cloud crds]# kubectl apply -f model.yaml devicemodel.devices.kubeedge.io/temperature-model-simulate created [root@cloud crds]# kubectl get crds temperature-model-simulate Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "temperature-model-simulate" not found
[root@cloud crds]# kubectl get devicemodel temperature-model-simulate NAME AGE temperature-model-simulate 2m41s [root@cloud crds]#
[root@cloud crds]# kubectl get devicemodel temperature-model-simulate -o yaml apiVersion: devices.kubeedge.io/v1alpha2 kind: DeviceModel metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"devices.kubeedge.io/v1alpha2","kind":"DeviceModel","metadata":{"annotations":{},"name":"temperature-model-simulate","namespace":"default"},"spec":{"properties":[{"description":"Temperature collected from the edge device","name":"temperature-status","type":{"string":{"accessMode":"ReadOnly","defaultValue":""}}}]}} creationTimestamp: "2021-06-02T03:48:54Z" generation: 1 managedFields: - apiVersion: devices.kubeedge.io/v1alpha2 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:spec: .: {} f:properties: {} manager: kubectl operation: Update time: "2021-06-02T03:48:54Z" name: temperature-model-simulate namespace: default resourceVersion: "6161945" selfLink: /apis/devices.kubeedge.io/v1alpha2/namespaces/default/devicemodels/temperature-model-simulate uid: cbba9acd-f79f-4cdb-a611-56c3e77bb030 spec: properties: - description: Temperature collected from the edge device name: temperature-status type: string: accessMode: ReadOnly defaultValue: "" [root@cloud crds]#
[root@cloud temperature_yaml]# kubectl get devicemodel NAME AGE temperature-model-simulate 4m50s traffic-light 19d [root@cloud temperature_yaml]# kubectl get device NAME AGE temperature-simulate 77s traffic-light-instance-01 39h [root@cloud temperature_yaml]#
以上是关于k8s crds的主要内容,如果未能解决你的问题,请参考以下文章