kubernetes.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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: VERSION
  34. value: "11"
  35. - name: RAM_SIZE
  36. value: "4G"
  37. - name: CPU_CORES
  38. value: "2"
  39. - name: DISK_SIZE
  40. value: "64G"
  41. volumeMounts:
  42. - mountPath: /storage
  43. name: storage
  44. - mountPath: /dev/kvm
  45. name: dev-kvm
  46. volumes:
  47. - name: storage
  48. persistentVolumeClaim:
  49. claimName: windows-pvc
  50. - name: dev-kvm
  51. hostPath:
  52. path: /dev/kvm
  53. ---
  54. apiVersion: v1
  55. kind: Service
  56. metadata:
  57. name: windows
  58. spec:
  59. type: NodePort
  60. selector:
  61. name: windows
  62. ports:
  63. - name: tcp-8006
  64. protocol: TCP
  65. port: 8006
  66. targetPort: 8006
  67. - name: tcp-3389
  68. protocol: TCP
  69. port: 3389
  70. targetPort: 3389
  71. - name: udp-3389
  72. protocol: UDP
  73. port: 3389
  74. targetPort: 3389