Merge pull request #45 from bjw-s/media-common

[media-common] Add openvpn add-on
This commit is contained in:
Nicholas St. Germain 2020-09-13 06:05:55 -05:00 committed by GitHub
commit 63b87146a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 80 additions and 8 deletions

View File

@ -2,10 +2,16 @@ apiVersion: v2
name: media-common
description: Common dependancy chart for media ecosystem containers
type: application
version: 1.0.1
version: 1.1.0
keywords:
- media-common
home: https://github.com/k8s-at-home/charts/tree/master/charts/media-common
maintainers:
- name: DirtyCajunRice
email: nick@cajun.pro
dependencies:
- name: media-common-openvpn
repository: https://k8s-at-home.com/charts/
version: ^1.0.0
condition: openvpn.enabled
alias: openvpn

View File

@ -22,4 +22,9 @@ These values will normally be nested as it is a dependency, for example:
```yaml
radarr:
<values>
```
```
## Add-ons
### OpenVPN
It is possible to enable an OpenVPN add-on by setting `openvpn.enabled: true`. For more information refer to [k8s-at-home/media-common-openvpn](https://github.com/k8s-at-home/charts/tree/master/charts/media-common-openvpn)

View File

@ -1,6 +1,30 @@
---
image:
organization: linuxserver
repository: radarr
tag: latest
service:
port: 7878
openvpn:
enabled: true
image:
repository: dperson/openvpn-client
tag: latest
pullPolicy: IfNotPresent
scripts:
up:
down:
networkPolicy:
enabled: false
livenessProbe:
initialDelaySeconds: 10
periodSeconds: 10
exec:
command:
- echo
- success

View File

@ -50,3 +50,27 @@ Selector labels
app.kubernetes.io/name: {{ include "media-common.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Additional Containers
*/}}
{{- define "media-common.additionalContainers" -}}
{{- if .Values.additionalContainers }}
{{- toYaml .Values.additionalContainers }}
{{- end }}
{{- if .Values.openvpn.enabled }}
{{ include "media-common.openvpn.container" . }}
{{- end }}
{{- end -}}
{{/*
Additional Volumes
*/}}
{{- define "media-common.additionalVolumes" -}}
{{- if .Values.additionalVolumes }}
{{- toYaml .Values.additionalVolumes }}
{{- end }}
{{- if .Values.openvpn.enabled }}
{{ include "media-common.openvpn.volume" . }}
{{- end }}
{{- end -}}

View File

@ -0,0 +1,8 @@
{{- if .Values.openvpn.enabled -}}
---
{{ include "media-common.openvpn.configmap" . }}
---
{{ include "media-common.openvpn.secret" . }}
---
{{ include "media-common.openvpn.networkpolicy" . }}
{{- end -}}

View File

@ -74,6 +74,7 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- include "media-common.additionalContainers" . | nindent 8 }}
volumes:
- name: config
{{- if .Values.persistence.config.enabled }}
@ -87,9 +88,7 @@ spec:
persistentVolumeClaim:
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "media-common.fullname" . }}-media{{- end }}
{{- end }}
{{- if .Values.additionalVolumes }}
{{- toYaml .Values.additionalVolumes | nindent 8 }}
{{- end }}
{{- include "media-common.additionalVolumes" . | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}

View File

@ -75,6 +75,7 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- include "media-common.additionalContainers" . | nindent 8 }}
volumes:
- name: config
{{- if .Values.persistence.config.enabled }}
@ -88,9 +89,7 @@ spec:
persistentVolumeClaim:
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "media-common.fullname" . }}-media{{- end }}
{{- end }}
{{- if .Values.additionalVolumes }}
{{- toYaml .Values.additionalVolumes | nindent 8 }}
{{- end }}
{{- include "media-common.additionalVolumes" . | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}

View File

@ -113,10 +113,17 @@ persistence:
## Do not delete the pvc upon helm uninstall
skipuninstall: false
additionalContainers: []
additionalVolumes: []
additionalVolumeMounts: []
# Enable the OpenVPN add-on here
# See https://github.com/k8s-at-home/charts/tree/master/charts/media-common-openvpn for more details
openvpn:
enabled: false
podSecurityContext: {}
# fsGroup: 2000