docs: Add TUN device (#940)

This commit is contained in:
Kilian von Pflugk 2024-12-01 16:07:23 +00:00 committed by GitHub
parent a4fdfbdf91
commit 9654a945fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 53 additions and 48 deletions

View File

@ -6,6 +6,7 @@ services:
VERSION: "11" VERSION: "11"
devices: devices:
- /dev/kvm - /dev/kvm
- /dev/net/tun
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
ports: ports:

View File

@ -1,10 +1,11 @@
---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: windows-pvc name: windows-pvc
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
requests: requests:
storage: 64Gi storage: 64Gi
@ -16,59 +17,61 @@ metadata:
labels: labels:
name: windows name: windows
spec: spec:
terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
containers: containers:
- name: windows - name: windows
image: dockurr/windows image: dockurr/windows
ports: env:
- containerPort: 8006 - name: VERSION
protocol: TCP value: "11"
- containerPort: 3389 - name: RAM_SIZE
protocol: TCP value: "4G"
- containerPort: 3389 - name: CPU_CORES
protocol: UDP value: "2"
securityContext: - name: DISK_SIZE
privileged: true value: "64G"
env: ports:
- name: VERSION - containerPort: 8006
value: "11" - containerPort: 3389
- name: RAM_SIZE - containerPort: 3389
value: "4G" protocol: UDP
- name: CPU_CORES securityContext:
value: "2" capabilities:
- name: DISK_SIZE add:
value: "64G" - NET_ADMIN
volumeMounts: privileged: true
- mountPath: /storage volumeMounts:
name: storage - mountPath: /storage
- mountPath: /dev/kvm name: storage
name: dev-kvm - mountPath: /dev/kvm
name: dev-kvm
- mountPath: /dev/net/tun
name: dev-tun
terminationGracePeriodSeconds: 120
volumes: volumes:
- name: storage - name: storage
persistentVolumeClaim: persistentVolumeClaim:
claimName: windows-pvc claimName: windows-pvc
- name: dev-kvm - hostPath:
hostPath: path: /dev/kvm
path: /dev/kvm name: dev-kvm
- hostPath:
path: /dev/net/tun
type: CharDevice
name: dev-tun
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: windows name: windows
spec: spec:
type: NodePort ports:
- name: tcp-8006
port: 8006
- name: tcp-3389
port: 3389
- name: udp-3389
port: 3389
protocol: UDP
selector: selector:
name: windows name: windows
ports: type: NodePort
- name: tcp-8006
protocol: TCP
port: 8006
targetPort: 8006
- name: tcp-3389
protocol: TCP
port: 3389
targetPort: 3389
- name: udp-3389
protocol: UDP
port: 3389
targetPort: 3389

View File

@ -37,6 +37,7 @@ services:
VERSION: "11" VERSION: "11"
devices: devices:
- /dev/kvm - /dev/kvm
- /dev/net/tun
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
ports: ports:
@ -49,7 +50,7 @@ services:
Via Docker CLI: Via Docker CLI:
```bash ```bash
docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows docker run -it --rm -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows
``` ```
Via Kubernetes: Via Kubernetes: