OPC-UA Adaptor

Introduction

OPC Unified Architecture (OPC-UA) is a machine to machine communication protocol for industrial automation developed by the OPC Foundation.

OPC-UA adaptor implements on gopcua/opcua and focus on communicating with the industrial OPC-UA equipment and systems for data collection and data manipulation on the edge side.

Registration Information

VersionsRegister NameEndpoint SocketAvailable
v1alpha1adaptors.edge.cattle.io/opcuaopcua.sock*

Support Model

KindGroupVersionAvailable
OPCUADevicedevices.edge.cattle.iov1alpha1*

Support Platform

OSArch
linuxamd64
linuxarm
linuxarm64

Usage

kubectl apply -f https://raw.githubusercontent.com/cnrancher/octopus/master/adaptors/opcua/deploy/e2e/all_in_one.yaml

Authority

Grant permissions to Octopus as below:

Resources Non-Resource URLs Resource Names Verbs
--------- ----------------- -------------- -----
opcuadevices.devices.edge.cattle.io [] [] [create delete get list patch update watch]
opcuadevices.devices.edge.cattle.io/status [] [] [get patch update]

Example

  • Specifies a OPCUADevice device link to connect a OPC-UA server.

    apiVersion: edge.cattle.io/v1alpha1
    kind: DeviceLink
    metadata:
    name: opcua
    spec:
    adaptor:
    node: edge-worker
    name: adaptors.edge.cattle.io/opcua
    model:
    apiVersion: "devices.edge.cattle.io/v1alpha1"
    kind: "OPCUADevice"
    template:
    metadata:
    labels:
    device: opcua
    spec:
    parameters:
    syncInterval: 5s
    timeout: 10s
    protocol:
    # replace the address if needed
    endpoint: opc.tcp://10.43.29.71:4840/
    properties:
    - name: datetime
    description: the current datetime
    readOnly: true
    visitor:
    nodeID: ns=0;i=2258
    type: datetime
    - name: integer
    description: mock number. Default value is 42
    readOnly: false
    visitor:
    nodeID: ns=1;s=the.answer
    type: int32
    value: "1"
    - name: string
    description: mock byte string. Default value is "test123"
    readOnly: false
    visitor:
    nodeID: ns=1;s=myByteString
    type: byteString
    value: "newString"

For more OPCUADevice device link examples, please refer to the deploy/e2e directory and make a quick experience with deploy/e2e/simulator.yaml.

OPCUADevice

ParameterDescriptionSchemaRequired
metadatametav1.ObjectMetafalse
specDefines the desired state of OPCUADevice.OPCUADeviceSpectrue
statusDefines the observed state of OPCUADevice.OPCUADeviceStatusfalse

OPCUADeviceSpec

ParameterDescriptionSchemaRequired
extensionSpecifies the extension of device.*OPCUADeviceExtensionfalse
parametersSpecifies the parameters of device.*OPCUADeviceParamtersfalse
protocolSpecifies the protocol for accessing the device.*OPCUADeviceProtocoltrue
propertiesSpecifies the properties of device.[]OPCUADevicePropertyfalse

OPCUADeviceStatus

ParameterDescriptionSchemaRequired
propertiesReports the properties of device.[]OPCUADeviceStatusPropertyfalse

OPCUADeviceParamters

ParameterDescriptionSchemaRequired
syncIntervalSpecifies the amount of interval that synchronized to limb, default to 15s.stringfalse
timeoutSpecifies the amount of timeout, default to 10s.stringfalse

OPCUADeviceProtocol

ParameterDescriptionSchemaRequired
endpointSpecifies the URL of OPC-UA server endpoint, which is start with "opc.tcp://".stringtrue
securityPolicySpecifies the security policy for accessing OPC-UA server, default to None.OPCUADeviceProtocolSecurityPolicyfalse
securityModeSpecifies the security mode for accessing OPC-UA server, default to None.OPCUADeviceProtocolSecurityModefalse
basicAuthSpecifies the username and password that the client connects to OPC-UA server.*OPCUADeviceProtocolBasicAuthfalse
tlsConfigSpecifies the TLS configuration that the client connects to OPC-UA server.*OPCUADeviceProtocolTLSfalse

OPCUADeviceProtocolSecurityPolicy

ParameterDescriptionSchemaRequired
Nonestring
Basic128Rsa15string
Basic256string
Basic256Sha256string
Aes128Sha256RsaOaepstring
Aes256Sha256RsaPssstring

OPCUADeviceProtocolSecurityMode

ParameterDescriptionSchema
Nonestring
Signstring
SignAndEncryptstring

OPCUADeviceProtocolBasicAuth

ParameterDescriptionSchemaRequired
usernameSpecifies the username for accessing OPC-UA server.stringfalse
usernameRefSpecifies the relationship of DeviceLink's references to refer to the value as the username.*edgev1alpha1.DeviceLinkReferenceRelationshipfalse
passwordSpecifies the password for accessing OPC-UA server.stringfalse
passwordRefSpecifies the relationship of DeviceLink's references to refer to the value as the password.*edgev1alpha1.DeviceLinkReferenceRelationshipfalse

OPCUADeviceProtocolTLS

ParameterDescriptionSchemaRequired
certFilePEMSpecifies the PEM format content of the certificate(public key), which is used for client authenticate to the OPC-UA server.stringfalse
certFilePEMRefSpecifies the relationship of DeviceLink's references to refer to the value as the client certificate file PEM content.*edgev1alpha1.DeviceLinkReferenceRelationshipfalse
keyFilePEMSpecifies the PEM format content of the key(private key), which is used for client authenticate to the OPC-UA server.stringfalse
keyFilePEMRefSpecifies the relationship of DeviceLink's references to refer to the value as the client key file PEM content.*edgev1alpha1.DeviceLinkReferenceRelationshipfalse

OPCUADeviceProperty

ParameterDescriptionSchemaRequired
nameSpecifies the name of property.stringtrue
descriptionSpecifies the description of property.stringfalse
typeSpecifies the type of property.OPCUADevicePropertyTypetrue
visitorSpecifies the visitor of property.OPCUADevicePropertyVisitortrue
readOnlySpecifies if the property is readonly, default is false.booleanfalse
valueSpecifies the value of property, only available in the writable property.stringfalse

OPCUADeviceStatusProperty

ParameterDescriptionSchemaRequired
nameReports the name of property.stringfalse
typeReports the type of property.OPCUADevicePropertyTypefalse
valueReports the value of property.stringfalse
updatedAtReports the updated timestamp of property.*metav1.Timefalse

OPCUADevicePropertyVisitor

ParameterDescriptionSchemaRequired
nodeIDSpecifies the id of OPC-UA node, e.g. "ns=1,i=1005".stringtrue
browseNameSpecifies the name of OPC-UA node.stringfalse

OPCUADevicePropertyType

ParameterDescriptionSchema
booleanProperty data type is boolean.string
int64Property data type is int64.string
int32Property data type is int32.string
int16Property data type is int16.string
uint64Property data type is uint64.string
uint32Property data type is uint32.string
uint16Property data type is uint16.string
floatProperty data type is float.string
doubleProperty data type is double.string
stringProperty data type is string.string
byteStringProperty data type is bytestring. Will be converted to string for display.string
datetimeProperty data type is datetime.string

OPCUADeviceExtension

ParameterDescriptionSchemaRequired
mqttSpecifies the MQTT settings.*v1alpha1.MQTTOptionsSpecfalse