deployment.yaml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {{ include "common.storage.hostPathValidate" .Values }}
  2. {{ include "common.deployment.common_config" . | nindent 0 }}
  3. spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
  4. template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
  5. spec:
  6. {{- if .Values.hostNetwork }}
  7. hostNetwork: {{ .Values.hostNetwork }}
  8. dnsPolicy: ClusterFirstWithHostNet
  9. {{- end }}
  10. hostname: {{ template "common.names.fullname" . }}
  11. {{- if hasKey .Values "global" }}
  12. {{- if hasKey .Values.global "ixChartContext" }}
  13. {{- if .Values.global.ixChartContext.addNvidiaRuntimeClass }}
  14. runtimeClassName: {{ .Values.global.ixChartContext.nvidiaRuntimeClassName }}
  15. {{- end }}
  16. {{- end }}
  17. {{- end }}
  18. containers:
  19. - name: {{ .Chart.Name }}
  20. {{ include "common.resources.limitation" . | nindent 10 }}
  21. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  22. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  23. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  24. - name: extrappvolume-{{ $index }}
  25. mountPath: {{ $hostPathConfiguration.mountPath }}
  26. {{ if $hostPathConfiguration.readOnly }}
  27. readOnly: {{ $hostPathConfiguration.readOnly }}
  28. {{ end }}
  29. {{ end }}
  30. ports:
  31. - name: emby
  32. protocol: TCP
  33. containerPort: 8096
  34. {{- if not .Values.hostNetwork }}
  35. hostPort: null
  36. {{- end }}
  37. - name: emby-dlna
  38. protocol: UDP
  39. containerPort: 1900
  40. {{- if not .Values.hostNetwork }}
  41. hostPort: null
  42. {{- end }}
  43. - name: emby-lnd
  44. protocol: UDP
  45. containerPort: 7359
  46. {{- if not .Values.hostNetwork }}
  47. hostPort: null
  48. {{- end }}
  49. env:
  50. - name: KUBE_NAMESPACE
  51. valueFrom:
  52. fieldRef:
  53. fieldPath: metadata.namespace
  54. - name: POD_IP
  55. valueFrom:
  56. fieldRef:
  57. fieldPath: status.podIP
  58. {{ $envList := (default list .Values.environmentVariables) }}
  59. {{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }}
  60. {{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }}
  61. {{ end }}
  62. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  63. readinessProbe:
  64. httpGet:
  65. path: /emby/System/Ping
  66. port: 8096
  67. initialDelaySeconds: 10
  68. periodSeconds: 10
  69. timeoutSeconds: 5
  70. failureThreshold: 5
  71. successThreshold: 2
  72. livenessProbe:
  73. httpGet:
  74. path: /emby/System/Ping
  75. port: 8096
  76. initialDelaySeconds: 10
  77. periodSeconds: 10
  78. timeoutSeconds: 5
  79. failureThreshold: 5
  80. successThreshold: 1
  81. startupProbe:
  82. httpGet:
  83. path: /emby/System/Ping
  84. port: 8096
  85. initialDelaySeconds: 10
  86. periodSeconds: 5
  87. timeoutSeconds: 2
  88. failureThreshold: 60
  89. successThreshold: 1
  90. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  91. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  92. - name: extrappvolume-{{ $index }}
  93. hostPath:
  94. path: {{ $hostPathConfiguration.hostPath }}
  95. {{ end }}