kubernetes.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. resources:
  31. limits:
  32. devices.kubevirt.io/kvm: 1
  33. securityContext:
  34. privileged: true
  35. env:
  36. - name: RAM_SIZE
  37. value: 4G
  38. - name: CPU_CORES
  39. value: "2"
  40. - name: DISK_SIZE
  41. value: "64G"
  42. volumeMounts:
  43. - mountPath: /storage
  44. name: storage
  45. volumes:
  46. - name: storage
  47. persistentVolumeClaim:
  48. claimName: windows-pvc
  49. ---
  50. apiVersion: v1
  51. kind: Service
  52. metadata:
  53. name: windows
  54. spec:
  55. type: NodePort
  56. selector:
  57. name: windows
  58. ports:
  59. - name: tcp-8006
  60. protocol: TCP
  61. port: 8006
  62. targetPort: 8006
  63. nodePort: 48006
  64. - name: tcp-3389
  65. protocol: TCP
  66. port: 3389
  67. targetPort: 3389
  68. nodePort: 43389
  69. - name: udp-3389
  70. protocol: UDP
  71. port: 3389
  72. targetPort: 3389
  73. nodePort: 43388