Skip to content

Commit

Permalink
fix: update templates of octopus and adaptors
Browse files Browse the repository at this point in the history
update the deploy templates of octopus and adaptors

closes #53
  • Loading branch information
guangbochen committed Apr 15, 2020
1 parent fdfab9d commit ff8b36e
Show file tree
Hide file tree
Showing 19 changed files with 82 additions and 37 deletions.
11 changes: 9 additions & 2 deletions adaptors/ble/deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
devices.edge.cattle.io/description: BLE stands for Bluetooth Low Energy (Bluetooth
LE, , and marketed as Bluetooth Smart). BLE is a form of wireless communication
designed for short-range communications. The BLE adaptor defines the device
configuration and the attributes of connected BLE device.
devices.edge.cattle.io/device-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/icon: https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/ble-logo.svg
creationTimestamp: null
labels:
app.kubernetes.io/name: octopus-adaptor-ble
Expand Down Expand Up @@ -207,11 +213,12 @@ spec:
containers:
- image: rancher/octopus-adaptor-ble:master
name: octopus
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
nodeSelector:
beta.kubernetes.io/os: linux
hostNetwork: true
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
3 changes: 3 additions & 0 deletions adaptors/ble/deploy/manifests/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
commonAnnotations:
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/device-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
devices.edge.cattle.io/icon: "https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/ble-logo.svg"
devices.edge.cattle.io/description: "BLE stands for Bluetooth Low Energy (Bluetooth LE, , and marketed as Bluetooth Smart). BLE is a form of wireless communication designed for short-range communications. The BLE adaptor defines the device configuration and the attributes of connected BLE device."

resources:
- base/devices.edge.cattle.io_bluetoothdevices.yaml
5 changes: 3 additions & 2 deletions adaptors/ble/deploy/manifests/workload/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ spec:
labels:
app.kubernetes.io/component: "adaptor"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
hostNetwork: true
containers:
- name: octopus
image: rancher/octopus-adaptor-ble:latest
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
Expand Down
5 changes: 3 additions & 2 deletions adaptors/dummy/deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
devices.edge.cattle.io/description: dummy device description
devices.edge.cattle.io/device-property: ""
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/icon: ""
creationTimestamp: null
labels:
app.kubernetes.io/name: octopus-adaptor-dummy
Expand Down Expand Up @@ -165,8 +168,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
nodeSelector:
beta.kubernetes.io/os: linux
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
3 changes: 3 additions & 0 deletions adaptors/dummy/deploy/manifests/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
commonAnnotations:
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/device-property: "" # specify device property to display in the UI
devices.edge.cattle.io/icon: "" # specify display icon for the UI
devices.edge.cattle.io/description: "dummy device description"

resources:
- base/devices.edge.cattle.io_dummydevices.yaml
2 changes: 0 additions & 2 deletions adaptors/dummy/deploy/manifests/workload/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
labels:
app.kubernetes.io/component: "adaptor"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- name: octopus
image: rancher/octopus-adaptor-dummy:latest
Expand Down
9 changes: 7 additions & 2 deletions adaptors/modbus/deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
devices.edge.cattle.io/description: Modbus is a communication protocol developed
by Modicon system. In short, it is a method for transmitting information between
electronic devices through a serial line. The Modbus protocol is a master-slave
architecture protocol. The Modbus adapter can be called a Modbus master station
and is responsible for connecting and collecting information from Modbus slave
stations (i.e, devices).
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/icon: https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/modbus.svg
devices.edge.cattle.io/status-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
creationTimestamp: null
labels:
Expand Down Expand Up @@ -290,8 +297,6 @@ spec:
name: sockets
- mountPath: /dev
name: dev
nodeSelector:
beta.kubernetes.io/os: linux
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
2 changes: 2 additions & 0 deletions adaptors/modbus/deploy/manifests/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
commonAnnotations:
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/status-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
devices.edge.cattle.io/icon: "https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/modbus.svg"
devices.edge.cattle.io/description: "Modbus is a communication protocol developed by Modicon system. In short, it is a method for transmitting information between electronic devices through a serial line. The Modbus protocol is a master-slave architecture protocol. The Modbus adapter can be called a Modbus master station and is responsible for connecting and collecting information from Modbus slave stations (i.e, devices)."

resources:
- base/devices.edge.cattle.io_modbusdevices.yaml
2 changes: 0 additions & 2 deletions adaptors/modbus/deploy/manifests/workload/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
labels:
app.kubernetes.io/component: "adaptor"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- name: octopus
image: rancher/octopus-adaptor-modbus:latest
Expand Down
5 changes: 5 additions & 0 deletions adaptors/opcua/deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
devices.edge.cattle.io/description: OPC Unified Architecture (OPC UA) is a machine
to machine communication protocol for industrial automation developed by the
OPC Foundation. OPC-UA adaptor focus on communicating with industrial equipment
and systems for data collection and control.
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/icon: https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/opc-ua.svg
devices.edge.cattle.io/status-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
creationTimestamp: null
labels:
Expand Down
2 changes: 2 additions & 0 deletions adaptors/opcua/deploy/manifests/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
commonAnnotations:
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/status-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
devices.edge.cattle.io/icon: "https://octopus-assets.oss-cn-beijing.aliyuncs.com/adaptor-icons/opc-ua.svg"
devices.edge.cattle.io/description: "OPC Unified Architecture (OPC UA) is a machine to machine communication protocol for industrial automation developed by the OPC Foundation. OPC-UA adaptor focus on communicating with industrial equipment and systems for data collection and control."

resources:
- base/devices.edge.cattle.io_opcuadevices.yaml
14 changes: 10 additions & 4 deletions deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,16 @@ spec:
app.kubernetes.io/name: octopus
app.kubernetes.io/version: master
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux
weight: 1
containers:
- args:
- brain
Expand All @@ -460,8 +470,6 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
nodeSelector:
beta.kubernetes.io/os: linux
terminationGracePeriodSeconds: 10
volumes:
- name: cert
Expand Down Expand Up @@ -504,8 +512,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
nodeSelector:
beta.kubernetes.io/os: linux
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
14 changes: 10 additions & 4 deletions deploy/e2e/all_in_one_without_webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,23 @@ spec:
app.kubernetes.io/name: octopus
app.kubernetes.io/version: master
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux
weight: 1
containers:
- args:
- brain
- --enable-leader-election
- --disable-admission-webhook
image: rancher/octopus:master
name: octopus
nodeSelector:
beta.kubernetes.io/os: linux
terminationGracePeriodSeconds: 10
---
apiVersion: apps/v1
Expand Down Expand Up @@ -391,8 +399,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
nodeSelector:
beta.kubernetes.io/os: linux
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
2 changes: 0 additions & 2 deletions deploy/manifests/workload/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
labels:
app.kubernetes.io/component: "limb"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- name: octopus
args:
Expand Down
12 changes: 10 additions & 2 deletions deploy/manifests/workload/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ spec:
labels:
app.kubernetes.io/component: "brain"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux
containers:
- name: octopus
args:
Expand Down
2 changes: 1 addition & 1 deletion template/adaptor/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions template/adaptor/deploy/e2e/all_in_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
devices.edge.cattle.io/description: ""
devices.edge.cattle.io/device-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}'
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/icon: ""
creationTimestamp: null
labels:
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
name: templatedevices.devices.edge.cattle.io
spec:
group: devices.edge.cattle.io
Expand Down Expand Up @@ -60,7 +63,7 @@ metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
name: octopus-adaptor-template-manager-role
rules:
- apiGroups:
Expand Down Expand Up @@ -90,7 +93,7 @@ metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
name: octopus-adaptor-template-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -107,30 +110,28 @@ metadata:
labels:
app.kubernetes.io/component: adaptor
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
name: octopus-adaptor-template-adaptor
namespace: octopus-system
spec:
selector:
matchLabels:
app.kubernetes.io/component: adaptor
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
template:
metadata:
labels:
app.kubernetes.io/component: adaptor
app.kubernetes.io/name: octopus-adaptor-template
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/version: master
spec:
containers:
- image: rancher/octopus-adaptor-template:latest
- image: rancher/octopus-adaptor-template:master
name: octopus
volumeMounts:
- mountPath: /var/lib/octopus/adaptors/
name: sockets
nodeSelector:
beta.kubernetes.io/os: linux
volumes:
- hostPath:
path: /var/lib/octopus/adaptors/
Expand Down
5 changes: 4 additions & 1 deletion template/adaptor/deploy/manifests/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
commonAnnotations:
devices.edge.cattle.io/enable: "true"
devices.edge.cattle.io/enable: "true" # this is required
devices.edge.cattle.io/device-property: '{"name":"string","dataType":"string","value":"string","updatedAt":"date"}' # specify device property to be displayed in the UI
devices.edge.cattle.io/icon: "" # define the icon for the Edge UI
devices.edge.cattle.io/description: "" # add your custom device adaptor description

resources:
- base/devices.edge.cattle.io_templatedevices.yaml
2 changes: 0 additions & 2 deletions template/adaptor/deploy/manifests/workload/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
labels:
app.kubernetes.io/component: "adaptor"
spec:
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- name: octopus
image: rancher/octopus-adaptor-template:latest
Expand Down

0 comments on commit ff8b36e

Please sign in to comment.