diff options
| author | peter <[email protected]> | 2021-01-12 20:26:19 -0800 |
|---|---|---|
| committer | peter <[email protected]> | 2021-01-12 20:26:19 -0800 |
| commit | b28dd7051782ceb87dadede8676cb7a88dc28881 (patch) | |
| tree | ddcb6876e1b2cf9525dccc4e6855e7bb065427a4 /helm/templates/deployment.yaml | |
| parent | Use IMAGE_PATH as a variable during envsubst for the full path of mac_hdd_ng.img (diff) | |
| download | docker-osx-b28dd7051782ceb87dadede8676cb7a88dc28881.tar.xz docker-osx-b28dd7051782ceb87dadede8676cb7a88dc28881.zip | |
add helm chart for running in Kubernetes
Diffstat (limited to 'helm/templates/deployment.yaml')
| -rw-r--r-- | helm/templates/deployment.yaml | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 0000000..e22daed --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,124 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "docker-osx.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "docker-osx.name" . }} + helm.sh/chart: {{ include "docker-osx.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "docker-osx.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "docker-osx.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + securityContext: + allowPrivilegeEscalation: true + readOnlyRootFilesystem: false + privileged: true + capabilities: + add: + - net_raw + - NET_ADMIN + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + tcpSocket: + port: http + readinessProbe: + tcpSocket: + port: http + env: + - name: CORES + value: "{{ .Values.resources.requests.cpu }}" + - name: SMP + value: "{{ .Values.resources.requests.cpu }}" + - name: RAM + value: "{{ .Values.resources.requests.memory | trimSuffix "Mi" }}" + - name: TZ + value: "{{ .Values.tz }}" + resources: +{{ toYaml .Values.resources | indent 10 }} + volumeMounts: + - mountPath: /home/arch/OSX-KVM/config.plist + subPath: config.plist + name: boot-components + - mountPath: /home/arch/OSX-KVM/macOS-libvirt-Catalina.xml + subPath: macOS-libvirt-Catalina.xml + name: boot-components + - mountPath: /home/arch/OSX-KVM/Launch_custom.sh + subPath: Launch_custom.sh + name: boot-components + - mountPath: /home/arch/OSX-KVM/vncpasswd_file + subPath: vncpasswd_file + name: boot-components + - mountPath: /dev/kvm + name: kvm + - mountPath: /dev/net/tun + name: tun + - mountPath: /dev/vfio/vfio + name: vfio + - mountPath: /dev/snd + name: snd + - mountPath: /tmp/.X11-unix + name: x11 + {{- if .Values.persistence.data.enabled }} + - name: data + mountPath: /mnt/data + {{- end }} + {{- if .Values.extraVolumeMounts }}{{ toYaml .Values.extraVolumeMounts | trim | nindent 8 }}{{ end }} + # args: + # - + volumes: + - name: boot-components + configMap: + name: {{ template "docker-osx.fullname" . }}-boot-components + items: + - key: config.plist + path: config.plist + - key: macOS-libvirt-Catalina.xml + path: macOS-libvirt-Catalina.xml + - key: Launch_custom.sh + path: Launch_custom.sh + - key: vncpasswd_file + path: vncpasswd_file + - name: kvm + hostPath: + path: /dev/kvm + - name: tun + hostPath: + path: /dev/net/tun + - name: vfio + hostPath: + path: /dev/vfio/vfio + - name: snd + hostPath: + path: /dev/snd + - name: x11 + hostPath: + path: /dev/ssd_data/default/{{ .Release.Name }}/.X11-unix + {{- if .Values.persistence.data.enabled }} + - name: data + persistentVolumeClaim: + claimName: {{ if .Values.persistence.data.existingClaim }}{{ .Values.persistence.data.existingClaim }}{{- else }}{{ template "docker-osx.fullname" . }}-data{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + {{- if .Values.extraVolumes }}{{ toYaml .Values.extraVolumes | trim | nindent 6 }}{{ end }} +{{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} +{{- end }} |