-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubernetes add DaemonSet for direct cameras
- Loading branch information
1 parent
f07ed5c
commit 7aae43c
Showing
3 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
|
||
metadata: | ||
name: cam-2 | ||
labels: | ||
app.kubernetes.io/name: cam-2 | ||
spec: | ||
revisionHistoryLimit: 3 | ||
|
||
updateStrategy: | ||
type: RollingUpdate | ||
|
||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: cam-2 | ||
|
||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: cam-2 | ||
|
||
spec: | ||
nodeName: hormex # change this to the desired host with given hardware | ||
automountServiceAccountToken: false | ||
enableServiceLinks: false | ||
containers: | ||
- name: prusa-connect-script | ||
tty: true # get that logs flowing to stdout/stderr | ||
envFrom: | ||
- secretRef: | ||
name: cam-2 | ||
image: quay.io/kaszpir/prusa-connect-script:latest | ||
imagePullPolicy: IfNotPresent | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: ["/bin/sh","-c","echo graceful-shutdown-start;sleep 2;echo graceful-shutdown-end"] # wait for inflight requests to finish | ||
livenessProbe: | ||
exec: | ||
command: | ||
- bash | ||
- -c | ||
- test $(find /dev/shm/ -mmin -1 | wc -l) -gt "0" | ||
initialDelaySeconds: 5 | ||
periodSeconds: 15 | ||
|
||
securityContext: | ||
# allowPrivilegeEscalation: false | ||
privileged: true | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
capabilities: | ||
drop: | ||
- ALL | ||
# add: | ||
# - NET_RAW # needed for ping if not using | ||
|
||
resources: | ||
requests: | ||
cpu: "0.1" | ||
memory: "32Mi" | ||
limits: | ||
cpu: "1.0" | ||
memory: "128Mi" | ||
|
||
volumeMounts: | ||
- mountPath: /dev/shm | ||
name: dev-shm | ||
- mountPath: /dev/video999 # must be the same as in `volumes` section and in cam.env | ||
name: dev-video | ||
# securityContext: | ||
# runAsUser: 1000 | ||
# # runAsGroup: video | ||
# # fsGroup: 2000 | ||
tolerations: | ||
- key: "rpi" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
terminationGracePeriodSeconds: 5 | ||
volumes: | ||
- name: dev-shm | ||
emptyDir: | ||
medium: Memory | ||
- name: dev-video | ||
hostPath: | ||
path: /dev/video1 # change this to the device on the host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ resources: | |
|
||
- deployment-1.yaml | ||
# - deployment-2.yaml | ||
- daemonset.yaml | ||
|
||
secretGenerator: | ||
- name: cam-1 | ||
|