docs: Add TUN device (#940)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled

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,3 +1,4 @@
---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
@ -16,19 +17,9 @@ 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:
- containerPort: 8006
protocol: TCP
- containerPort: 3389
protocol: TCP
- containerPort: 3389
protocol: UDP
securityContext:
privileged: true
env: env:
- name: VERSION - name: VERSION
value: "11" value: "11"
@ -38,37 +29,49 @@ spec:
value: "2" value: "2"
- name: DISK_SIZE - name: DISK_SIZE
value: "64G" value: "64G"
ports:
- containerPort: 8006
- containerPort: 3389
- containerPort: 3389
protocol: UDP
securityContext:
capabilities:
add:
- NET_ADMIN
privileged: true
volumeMounts: volumeMounts:
- mountPath: /storage - mountPath: /storage
name: storage name: storage
- mountPath: /dev/kvm - mountPath: /dev/kvm
name: 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
selector:
name: windows
ports: ports:
- name: tcp-8006 - name: tcp-8006
protocol: TCP
port: 8006 port: 8006
targetPort: 8006
- name: tcp-3389 - name: tcp-3389
protocol: TCP
port: 3389 port: 3389
targetPort: 3389
- name: udp-3389 - name: udp-3389
protocol: UDP
port: 3389 port: 3389
targetPort: 3389 protocol: UDP
selector:
name: windows
type: NodePort

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: