• 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]#
  • 相关阅读:
    填空:类型转换1
    :其他基本数据类型存储空间大小
    10:Hello, World!的大小
    09:整型与布尔型的转换
    08:打印字符
    07:打印ASCII码
    06:浮点数向零舍入
    05:填空:类型转换2
    04:填空:类型转换1
    03:其他基本数据类型存储空间大小
  • 原文地址:https://www.cnblogs.com/dream397/p/14840723.html
Copyright © 2020-2023  润新知