0
|
1 apiVersion: apps/v1
|
|
2 kind: Deployment
|
|
3 metadata:
|
|
4 name: doorbell
|
|
5 spec:
|
|
6 replicas: 1
|
|
7 strategy: { type: Recreate }
|
|
8 selector: { matchLabels: { app: doorbell } }
|
|
9 template:
|
|
10 metadata:
|
|
11 labels: { app: doorbell }
|
|
12 annotations: { prometheus.io/scrape: "false" }
|
|
13 spec:
|
|
14 containers:
|
|
15 - name: doorbell
|
|
16 image: bang5:5000/doorbell_image
|
|
17 args:
|
|
18 - pdm
|
|
19 - run
|
|
20 - python
|
|
21 - doorbell_to_mqtt.py
|
|
22 - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900cepU-if00-port0
|
|
23 securityContext: { privileged: true }
|
|
24
|
|
25 volumeMounts:
|
|
26 - { name: dev, mountPath: /dev }
|
|
27 volumes:
|
|
28 - { name: dev, hostPath: { path: /dev, type: Directory } }
|
|
29
|
|
30 affinity:
|
|
31 nodeAffinity:
|
|
32 requiredDuringSchedulingIgnoredDuringExecution:
|
|
33 { nodeSelectorTerms: [{ matchExpressions: [{ key: "kubernetes.io/hostname", operator: In, values: ["bang"] }] }] }
|
1
|
34
|
|
35 ---
|
|
36 apiVersion: v1
|
|
37 kind: Service
|
|
38 metadata:
|
|
39 name: doorbell
|
|
40 spec:
|
|
41 ports:
|
|
42 - {port: 80, targetPort: 8000}
|
|
43 selector:
|
|
44 app: doorbell
|