macos/kubernetes.yml

73 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2024-05-16 00:19:27 +00:00
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
2024-06-04 09:57:27 +00:00
name: macos-pvc
2024-05-16 00:19:27 +00:00
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
2024-06-10 23:53:13 +00:00
storage: 64Gi
2024-05-16 00:19:27 +00:00
---
apiVersion: v1
kind: Pod
metadata:
2024-06-04 09:57:27 +00:00
name: macos
2024-05-16 00:19:27 +00:00
labels:
2024-06-04 09:57:27 +00:00
name: macos
2024-05-16 00:19:27 +00:00
spec:
terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
containers:
2024-06-04 09:57:27 +00:00
- name: macos
image: dockurr/macos
2024-05-16 00:19:27 +00:00
ports:
- containerPort: 8006
protocol: TCP
2024-06-02 19:50:07 +00:00
- containerPort: 5000
2024-05-16 00:19:27 +00:00
protocol: TCP
2024-06-02 19:50:07 +00:00
- containerPort: 5000
2024-05-16 00:19:27 +00:00
protocol: UDP
securityContext:
privileged: true
env:
- name: RAM_SIZE
2024-06-10 23:53:13 +00:00
value: 4G
2024-05-16 00:19:27 +00:00
- name: CPU_CORES
value: "2"
- name: DISK_SIZE
2024-06-10 23:53:13 +00:00
value: "64G"
2024-05-16 00:19:27 +00:00
volumeMounts:
- mountPath: /storage
name: storage
- mountPath: /dev/kvm
name: dev-kvm
2024-05-16 00:19:27 +00:00
volumes:
- name: storage
persistentVolumeClaim:
2024-06-04 09:57:27 +00:00
claimName: macos-pvc
- name: dev-kvm
hostPath:
path: /dev/kvm
2024-05-16 00:19:27 +00:00
---
apiVersion: v1
kind: Service
metadata:
2024-06-04 09:57:27 +00:00
name: macos
2024-05-16 00:19:27 +00:00
spec:
type: NodePort
selector:
2024-06-04 09:57:27 +00:00
name: macos
2024-05-16 00:19:27 +00:00
ports:
- name: tcp-8006
protocol: TCP
port: 8006
targetPort: 8006
2024-06-02 13:23:39 +00:00
- name: tcp-5900
2024-05-16 00:19:27 +00:00
protocol: TCP
2024-06-02 13:23:39 +00:00
port: 5900
targetPort: 5900
- name: udp-5900
2024-05-16 00:19:27 +00:00
protocol: UDP
2024-06-02 13:23:39 +00:00
port: 5900
targetPort: 5900