mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
[common] Add controller labels and annotations (#134)
This commit is contained in:
parent
9a88e697d2
commit
1799d4c057
@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
name: common
|
name: common
|
||||||
description: Function library for k8s-at-home charts
|
description: Function library for k8s-at-home charts
|
||||||
type: library
|
type: library
|
||||||
version: 1.0.5
|
version: 1.1.0
|
||||||
keywords:
|
keywords:
|
||||||
- k8s-at-home
|
- k8s-at-home
|
||||||
- common
|
- common
|
||||||
|
@ -5,6 +5,13 @@ metadata:
|
|||||||
name: {{ template "common.names.fullname" . }}
|
name: {{ template "common.names.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.controllerLabels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.controllerAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
{{- if not $ingressValues.nameSuffix -}}
|
{{- if not $ingressValues.nameSuffix -}}
|
||||||
{{- $_ := set $ingressValues "nameSuffix" $index -}}
|
{{- $_ := set $ingressValues "nameSuffix" $index -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{- $_ := set . "ObjectValues" (dict "ingress" $ingressValues) -}}
|
{{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}}
|
||||||
{{- include "common.classes.ingress" . -}}
|
{{- include "common.classes.ingress" $ -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
{{- define "common.pvc" -}}
|
{{- define "common.pvc" -}}
|
||||||
{{- /* Generate pvc as required */ -}}
|
{{- /* Generate pvc as required */ -}}
|
||||||
{{- $context := . -}}
|
|
||||||
{{- range $index, $PVC := .Values.persistence }}
|
{{- range $index, $PVC := .Values.persistence }}
|
||||||
{{- if and $PVC.enabled (not (or $PVC.emptyDir $PVC.existingClaim)) -}}
|
{{- if and $PVC.enabled (not (or $PVC.emptyDir $PVC.existingClaim)) -}}
|
||||||
{{- $persistenceValues := $PVC -}}
|
{{- $persistenceValues := $PVC -}}
|
||||||
{{- if not $persistenceValues.nameSuffix -}}
|
{{- if not $persistenceValues.nameSuffix -}}
|
||||||
{{- $_ := set $persistenceValues "nameSuffix" $index -}}
|
{{- $_ := set $persistenceValues "nameSuffix" $index -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $_ := set $context "ObjectValues" (dict "persistence" $persistenceValues) -}}
|
{{- $_ := set $ "ObjectValues" (dict "persistence" $persistenceValues) -}}
|
||||||
{{- print ("---") | nindent 0 -}}
|
{{- print ("---") | nindent 0 -}}
|
||||||
{{- include "common.classes.pvc" $context -}}
|
{{- include "common.classes.pvc" $ -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
{{- define "common.service" -}}
|
{{- define "common.service" -}}
|
||||||
{{- if .Values.service.enabled -}}
|
{{- if .Values.service.enabled -}}
|
||||||
|
{{- /* Generate primary service */ -}}
|
||||||
{{- include "common.classes.service" . }}
|
{{- include "common.classes.service" . }}
|
||||||
|
|
||||||
|
{{- /* Generate additional services as required */ -}}
|
||||||
|
{{- range $index, $extraService := .Values.service.additionalServices }}
|
||||||
|
{{- if $extraService.enabled -}}
|
||||||
|
{{- print ("---") | nindent 0 -}}
|
||||||
|
{{- $serviceValues := $extraService -}}
|
||||||
|
{{- if not $serviceValues.nameSuffix -}}
|
||||||
|
{{- $_ := set $serviceValues "nameSuffix" $index -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "service" $serviceValues) -}}
|
||||||
|
{{- include "common.classes.service" $ -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -5,6 +5,13 @@ metadata:
|
|||||||
name: {{ template "common.names.fullname" . }}
|
name: {{ template "common.names.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.controllerLabels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.controllerAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
The OpenVPN shared volume to be inserted
|
The OpenVPN shared volume to be inserted
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "common.addon.vpn.volume" -}}
|
{{- define "common.addon.vpn.volume" -}}
|
||||||
{{- if or .Values.addons.vpn.vpnConf .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down -}}
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down -}}
|
||||||
name: vpnconfig
|
name: vpnconfig
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ template "common.names.fullname" . }}-vpn
|
name: {{ template "common.names.fullname" . }}-vpn
|
||||||
items:
|
items:
|
||||||
{{- if .Values.addons.vpn.vpnConf }}
|
{{- if .Values.addons.vpn.configFile }}
|
||||||
- key: vpnConfigfile
|
- key: vpnConfigfile
|
||||||
path: vpnConfigfile
|
path: vpnConfigfile
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -5,11 +5,15 @@
|
|||||||
{{- $values = . -}}
|
{{- $values = . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
{{- $serviceName := include "common.names.fullname" . -}}
|
||||||
|
{{- if hasKey $values "nameSuffix" -}}
|
||||||
|
{{- $serviceName = printf "%v-%v" $serviceName $values.nameSuffix -}}
|
||||||
|
{{ end -}}
|
||||||
{{- $svcType := $values.type -}}
|
{{- $svcType := $values.type -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "common.names.fullname" . }}
|
name: {{ $serviceName }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
{{- if $values.labels }}
|
{{- if $values.labels }}
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# type: options are statefulset or deployment
|
# type: options are statefulset or deployment
|
||||||
controllerType: deployment
|
controllerType: deployment
|
||||||
|
# Set annotations on the deployment/statefulset
|
||||||
|
controllerAnnotations: {}
|
||||||
|
# Set labels on the deployment/statefulset
|
||||||
|
controllerLabels: {}
|
||||||
|
|
||||||
|
# Set annotations on the pod
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
env: {}
|
env: {}
|
||||||
|
|
||||||
@ -47,6 +54,21 @@ service:
|
|||||||
annotations: {}
|
annotations: {}
|
||||||
labels: {}
|
labels: {}
|
||||||
|
|
||||||
|
additionalServices: []
|
||||||
|
# - enabled: false
|
||||||
|
# nameSuffix: api
|
||||||
|
# type: ClusterIP
|
||||||
|
# # Specify the default port information
|
||||||
|
# port:
|
||||||
|
# port: ""
|
||||||
|
# name: http
|
||||||
|
# protocol: TCP
|
||||||
|
# targetPort: http
|
||||||
|
# # nodePort:
|
||||||
|
# additionalPorts: []
|
||||||
|
# annotations: {}
|
||||||
|
# labels: {}
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user