diff --git a/apps-kustomized/ser2net/common.yaml b/apps-kustomized/ser2net/common.yaml new file mode 100644 index 0000000..43af3d2 --- /dev/null +++ b/apps-kustomized/ser2net/common.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + name: ser2net + name: ser2net diff --git a/apps-kustomized/ser2net/kustomization.yaml b/apps-kustomized/ser2net/kustomization.yaml new file mode 100644 index 0000000..e177c4d --- /dev/null +++ b/apps-kustomized/ser2net/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: ser2net + +resources: + - common.yaml + - ser2net-zigbee.yaml + - ser2net-zwave.yaml diff --git a/apps-kustomized/ser2net/ser2net-zigbee.yaml b/apps-kustomized/ser2net/ser2net-zigbee.yaml new file mode 100644 index 0000000..e217e74 --- /dev/null +++ b/apps-kustomized/ser2net/ser2net-zigbee.yaml @@ -0,0 +1,102 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ser2net +data: + ser2net.yaml: | + %YAML 1.1 + --- + define: &confver 1.0 + define: &banner Connected to port \N(\d)\r\n + default: + name: local + value: true + class: serialdev + default: + name: mdns + value: false + default: + name: mdns-sysattrs + value: true + default: + name: speed + value: 115200n81 + connection: &con01 + accepter: tcp,3001 + connector: serialdev,/dev/zig,115200n81,nobreak,local + options: + kickolduser: true +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ser2net + namespace: home-automation + labels: + app.kubernetes.io/name: ser2net + app.kubernetes.io/instance: rfxcom + annotations: + configmap.reloader.stakater.com/reload: "ser2net" +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: ser2net + app.kubernetes.io/instance: rfxcom + template: + metadata: + labels: + app.kubernetes.io/name: ser2net + app.kubernetes.io/instance: rfxcom + annotations: + descheduler.alpha.kubernetes.io/evict: "true" + spec: + containers: + - name: ser2net + image: jippi/ser2net:latest + resources: {} + securityContext: + allowPrivilegeEscalation: true + privileged: true + ports: + - containerPort: 3001 + protocol: TCP + volumeMounts: + - mountPath: /etc/ser2net + name: configmap + - name: usb-conbee + mountPath: /dev/zig + volumes: + - configMap: + name: ser2net + name: configmap + - name: usb-conbee + hostPath: + path: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2669726-if00 + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: feature.node.kubernetes.io/usb-02_1cf1_0030.present + operator: Exists +--- +kind: Service +apiVersion: v1 +metadata: + name: ser2net + namespace: home-automation + labels: + app.kubernetes.io/name: ser2net + app.kubernetes.io/instance: rfxcom +spec: + selector: + app.kubernetes.io/name: ser2net + app.kubernetes.io/instance: rfxcom + ports: + - name: http + protocol: TCP + port: 3001 + targetPort: 3001 diff --git a/apps-kustomized/ser2net/ser2net-zwave.yaml b/apps-kustomized/ser2net/ser2net-zwave.yaml new file mode 100644 index 0000000..e8bc5c3 --- /dev/null +++ b/apps-kustomized/ser2net/ser2net-zwave.yaml @@ -0,0 +1,102 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ser2net-zwave +data: + ser2net.yaml: | + %YAML 1.1 + --- + define: &confver 1.0 + define: &banner Connected to port \N(\d)\r\n + default: + name: local + value: true + class: serialdev + default: + name: mdns + value: false + default: + name: mdns-sysattrs + value: true + default: + name: speed + value: 115200n81 + connection: &con01 + accepter: tcp,3002 + connector: serialdev,/dev/zwave,115200N81 + options: + kickolduser: true +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ser2net-zwave + namespace: home-automation + labels: + app.kubernetes.io/name: ser2net-zwave + app.kubernetes.io/instance: rfxcom + annotations: + configmap.reloader.stakater.com/reload: "ser2net-zwave" +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: ser2net-zwave + app.kubernetes.io/instance: rfxcom + template: + metadata: + labels: + app.kubernetes.io/name: ser2net-zwave + app.kubernetes.io/instance: rfxcom + annotations: + descheduler.alpha.kubernetes.io/evict: "true" + spec: + containers: + - name: ser2net-zwave + image: jippi/ser2net:latest + resources: {} + securityContext: + allowPrivilegeEscalation: true + privileged: true + ports: + - containerPort: 3002 + protocol: TCP + volumeMounts: + - mountPath: /etc/ser2net + name: configmap + - name: usb-zooz + mountPath: /dev/zwave + volumes: + - configMap: + name: ser2net-zwave + name: configmap + - name: usb-zooz + hostPath: + path: /dev/serial/by-id/usb-Silicon_Labs_Zooz_ZST10_700_Z-Wave_Stick_baf11d5406caec11b51361a341be1031-if00-port0 + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: feature.node.kubernetes.io/usb-ff_10c4_ea60.present #zooz + operator: Exists +--- +kind: Service +apiVersion: v1 +metadata: + name: ser2net-zwave + namespace: home-automation + labels: + app.kubernetes.io/name: ser2net-zwave + app.kubernetes.io/instance: rfxcom +spec: + selector: + app.kubernetes.io/name: ser2net-zwave + app.kubernetes.io/instance: rfxcom + ports: + - name: http + protocol: TCP + port: 3002 + targetPort: 3002 diff --git a/everything-app/ser2net.yaml b/everything-app/ser2net.yaml new file mode 100644 index 0000000..60427f1 --- /dev/null +++ b/everything-app/ser2net.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: ser2net + namespace: argocd +spec: + destination: + namespace: ser2net + server: https://kubernetes.default.svc + project: infra + source: + path: apps-kustomized/ser2net + repoURL: https://git.martyn.berlin/martyn/infra4talos + targetRevision: HEAD + syncPolicy: + automated: + selfHeal: true