Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
4b3bad4e
Commit
4b3bad4e
authored
Jan 30, 2021
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update plex chart to use library chart to render services configuration
parent
387dd828
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
118 deletions
+25
-118
test/plex/1.0.1/templates/_helpers.tpl
test/plex/1.0.1/templates/_helpers.tpl
+0
-52
test/plex/1.0.1/templates/service-tcp.yaml
test/plex/1.0.1/templates/service-tcp.yaml
+16
-35
test/plex/1.0.1/templates/service-udp.yaml
test/plex/1.0.1/templates/service-udp.yaml
+9
-31
No files found.
test/plex/1.0.1/templates/_helpers.tpl
deleted
100644 → 0
View file @
387dd828
{{
/*
vim
:
set
filetype
=
mustache
:
*/
}}
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{{- define "plex.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Create
a
default
fully
qualified
app
name
.
We
truncate
at
63
chars
because
some
Kubernetes
name
fields
are
limited
to
this
(
by
the
DNS
naming
spec
).
If
release
name
contains
chart
name
it
will
be
used
as
a
full
name
.
*/
}
}
{{- define "plex.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{
{
/*
Create
chart
name
and
version
as
used
by
the
chart
label
.
*/
}
}
{{- define "plex.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Common
labels
*/
}
}
{{- define "plex.labels" -}}
helm.sh/chart: {{ include "plex.chart" . }}
{{ include "plex.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{
{
/*
Selector
labels
*/
}
}
{{- define "plex.selectorLabels" -}}
app.kubernetes.io/name: {{ include "plex.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
test/plex/1.0.1/templates/service-tcp.yaml
View file @
4b3bad4e
apiVersion
:
v1
{{
$svc
:
= .Values.plexServiceTCP
}}
kind
:
Service
{{
$ports
:
= list
}}
metadata
:
{{
$ports = mustAppend $ports (dict "name" "pms" "port" $svc.port "nodePort" $svc.port "targetPort" "pms")
}}
{{
- if .Values.hostNetwork
}}
{{
$ports = mustAppend $ports (dict "name" "http" "port" 80 "targetPort" "pms")
}}
name
:
{{
include "plex.fullname" .
}}
-tcp-cluster-ip
{{
$ports = mustAppend $ports (dict "name" "https" "port" 443 "targetPort" "pms")
}}
{{
- else
}}
{{
$ports = mustAppend $ports (dict "name" "plex-dlna" "port" 1900 "targetPort" "plex-dlna")
}}
name
:
{{
include "plex.fullname" .
}}
-tcp
{{
$params
:
= .
}}
{{
- end
}}
{{
$_
:
= set $params "service" (dict "ports" $ports )
}}
labels
:
{{
if .Values.hostNetwork
}}
{{
- include "plex.labels" . | nindent 4
}}
{{
$_
:
= set $params.service "nameSuffix" "tcp-cluster-ip"
}}
spec
:
{{
$_1
:
= set $params.service "type" "ClusterIP"
}}
{{
- if .Values.hostNetwork
}}
{{
else
}}
type
:
ClusterIP
{{
$_
:
= set $params.service "nameSuffix" "tcp"
}}
{{
- else
}}
{{
$_1
:
= set $params.service "type" "NodePort"
}}
type
:
NodePort
{{
end
}}
{{
- end
}}
{{
include "common.classes.service" $params
}}
ports
:
-
name
:
pms
port
:
{{
.Values.plexServiceTCP.port
}}
protocol
:
TCP
targetPort
:
pms
{{
- if eq .Values.hostNetwork false
}}
nodePort
:
{{
.Values.plexServiceTCP.port
}}
{{
- end
}}
-
name
:
http
port
:
80
targetPort
:
pms
-
name
:
https
port
:
443
targetPort
:
pms
-
name
:
plex-dlna
port
:
1900
targetPort
:
plex-dlna
selector
:
{{
- include "plex.selectorLabels" . | nindent 4
}}
test/plex/1.0.1/templates/service-udp.yaml
View file @
4b3bad4e
apiVersion
:
v1
{{
$ports
:
= list
}}
kind
:
Service
{{
$ports = mustAppend $ports (dict "name" "plex-dlna-udp" "port" 1900 "protocol" "UDP" "targetPort" "plex-dlna-udp")
}}
metadata
:
{{
$ports = mustAppend $ports (dict "name" "plex-gdm1" "port" 32410 "protocol" "UDP" "targetPort" "plex-gdm1")
}}
name
:
{{
include "plex.fullname" .
}}
-udp
{{
$ports = mustAppend $ports (dict "name" "plex-gdm2" "port" 32412 "protocol" "UDP" "targetPort" "plex-gdm2")
}}
labels
:
{{
$ports = mustAppend $ports (dict "name" "plex-gdm3" "port" 32413 "protocol" "UDP" "targetPort" "plex-gdm3")
}}
{{
- include "plex.labels" . | nindent 4
}}
{{
$ports = mustAppend $ports (dict "name" "plex-gdm4" "port" 32414 "protocol" "UDP" "targetPort" "plex-gdm4")
}}
spec
:
{{
$params
:
= .
}}
type
:
ClusterIP
{{
$_
:
= set $params "service" (dict "type" "ClusterIP" "ports" $ports "nameSuffix" "udp" )
}}
ports
:
{{
include "common.classes.service" $params
}}
-
name
:
plex-dlna-udp
port
:
1900
protocol
:
UDP
targetPort
:
plex-dlna-udp
-
name
:
plex-gdm1
port
:
32410
protocol
:
UDP
targetPort
:
plex-gdm1
-
name
:
plex-gdm2
port
:
32412
protocol
:
UDP
targetPort
:
plex-gdm2
-
name
:
plex-gdm3
port
:
32413
protocol
:
UDP
targetPort
:
plex-gdm3
-
name
:
plex-gdm4
port
:
32414
protocol
:
UDP
targetPort
:
plex-gdm4
selector
:
{{
- include "plex.selectorLabels" . | nindent 4
}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment