Commit c46d6fd7 authored by Waqar Ahmed's avatar Waqar Ahmed

Update plex deployment to use library chart

parent 8e0915ab
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "plex.fullname" . }} name: {{ include "common.names.fullname" . }}
labels: labels: {{ include "common.labels" . | nindent 4 }}
{{- include "plex.labels" . | nindent 4 }}
spec: spec:
replicas: 1 replicas: 1
revisionHistoryLimit: 3 revisionHistoryLimit: 3
strategy: strategy:
type: {{ .Values.strategyType }} type: {{ .Values.strategyType }}
selector: selector:
matchLabels: matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
{{- include "plex.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
labels: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
{{- include "plex.selectorLabels" . | nindent 8 }} annotations: {{ include "common.annotations" . | nindent 8 }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec: spec:
{{- if .Values.hostNetwork }} {{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }} hostNetwork: {{ .Values.hostNetwork }}
...@@ -25,8 +21,7 @@ spec: ...@@ -25,8 +21,7 @@ spec:
{{- end }} {{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: pms - name: pms
protocol: TCP protocol: TCP
...@@ -53,29 +48,16 @@ spec: ...@@ -53,29 +48,16 @@ spec:
protocol: UDP protocol: UDP
containerPort: 32414 containerPort: 32414
env: env:
- name: TZ - name: KUBE_NAMESPACE
value: "{{ .Values.timezone }}" valueFrom:
# TODO: move this to a secret? fieldRef:
- name: PLEX_CLAIM fieldPath: metadata.namespace
value: "{{ .Values.claimToken }}" {{ $envList := (default list .Values.environmentVariables) }}
# plex env vars {{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
- name: PMS_INTERNAL_ADDRESS {{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
value: http://{{ template "plex.fullname" . }}:32400 {{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
- name: PMS_IMAGE {{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
value: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
- name: KUBE_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# Extra ENV Values supplied by user
{{- range $envVariable := .Values.environmentVariables }}
{{- if and $envVariable.name $envVariable.value }}
- name: {{ $envVariable.name }}
value: {{ $envVariable.value | quote }}
{{- else }}
{{- fail "Please specify name/value for environment variable" }}
{{- end }}
{{- end}}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /identity path: /identity
...@@ -112,28 +94,11 @@ spec: ...@@ -112,28 +94,11 @@ spec:
{{- toYaml .Values.gpuConfiguration | nindent 14 }} {{- toYaml .Values.gpuConfiguration | nindent 14 }}
{{- end }} {{- end }}
volumes: volumes:
- name: data {{ $emptyDir := .Values.emptyDirVolumes }}
{{- if .Values.emptyDirVolumes }} {{ $vols := list }}
emptyDir: {} {{ $vols = mustAppend $vols (dict "name" "data" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.dataHostPathEnabled "pathField" .Values.dataHostPath "datasetName" (.Values.dataVolume | default dict).datasetName ) }}
{{- else }} {{ $vols = mustAppend $vols (dict "name" "config" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.configHostPathEnabled "pathField" .Values.configHostPath "datasetName" (.Values.configVolume | default dict).datasetName ) }}
hostPath: {{ $vols = mustAppend $vols (dict "name" "transcode" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.transcodeHostPathEnabled "pathField" .Values.transcodeHostPath "datasetName" (.Values.transcodeVolume | default dict).datasetName ) }}
path: {{ template "configuredHostPathData" . }} {{ $vols = mustAppend $vols (dict "name" "shared" "emptyDirVolumes" true "hostPathEnabled" false "pathField" nil "datasetName" nil) }}
{{- end }} {{ $vols = mustAppend $vols (dict "name" "shared-logs" "emptyDirVolumes" true "hostPathEnabled" false "pathField" nil "datasetName" nil) }}
- name: config {{ include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8 }}
{{- if .Values.emptyDirVolumes }}
emptyDir: {}
{{- else }}
hostPath:
path: {{ template "configuredHostPathConfig" . }}
{{- end }}
- name: transcode
{{- if .Values.emptyDirVolumes }}
emptyDir: {}
{{- else }}
hostPath:
path: {{ template "configuredHostPathTranscode" . }}
{{- end }}
- name: shared
emptyDir: {}
- name: shared-logs
emptyDir: {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment