1
0

kubernetes.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. apiVersion: v1
  2. kind: PersistentVolumeClaim
  3. metadata:
  4. name: windows-pvc
  5. spec:
  6. accessModes:
  7. - ReadWriteOnce
  8. resources:
  9. requests:
  10. storage: 64Gi
  11. ---
  12. apiVersion: v1
  13. kind: Pod
  14. metadata:
  15. name: windows
  16. labels:
  17. name: windows
  18. spec:
  19. terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
  20. containers:
  21. - name: windows
  22. image: dockurr/windows
  23. ports:
  24. - containerPort: 8006
  25. protocol: TCP
  26. - containerPort: 3389
  27. protocol: TCP
  28. - containerPort: 3389
  29. protocol: UDP
  30. securityContext:
  31. privileged: true
  32. env:
  33. - name: RAM_SIZE
  34. value: 4G
  35. - name: CPU_CORES
  36. value: "2"
  37. - name: DISK_SIZE
  38. value: "64G"
  39. volumeMounts:
  40. - mountPath: /storage
  41. name: storage
  42. - mountPath: /dev/kvm
  43. name: dev-kvm
  44. volumes:
  45. - name: storage
  46. persistentVolumeClaim:
  47. claimName: windows-pvc
  48. - name: dev-kvm
  49. hostPath:
  50. path: /dev/kvm
  51. ---
  52. apiVersion: v1
  53. kind: Service
  54. metadata:
  55. name: windows
  56. spec:
  57. type: NodePort
  58. selector:
  59. name: windows
  60. ports:
  61. - name: tcp-8006
  62. protocol: TCP
  63. port: 8006
  64. targetPort: 8006
  65. - name: tcp-3389
  66. protocol: TCP
  67. port: 3389
  68. targetPort: 3389
  69. - name: udp-3389
  70. protocol: UDP
  71. port: 3389
  72. targetPort: 3389