deployment.yaml 4.1 KB

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