mirror of
				https://github.com/TeamPiped/Piped-Kubernetes.git
				synced 2024-08-14 23:57:15 +00:00 
			
		
		
		
	Progress
This commit is contained in:
		
							parent
							
								
									73ac9b4437
								
							
						
					
					
						commit
						52ed0d9374
					
				
					 41 changed files with 2439 additions and 269 deletions
				
			
		
							
								
								
									
										64
									
								
								charts/apps/piped/templates/ytproxy/lib/_volumes.tpl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								charts/apps/piped/templates/ytproxy/lib/_volumes.tpl
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,64 @@ | |||
| {{/* | ||||
| Volumes included by the controller. | ||||
| */}} | ||||
| {{- define "ytproxy.controller.volumes" -}} | ||||
| {{- range $index, $persistence := .Values.persistence }} | ||||
| {{- if $persistence.enabled }} | ||||
| - name: {{ $index }} | ||||
|   {{- if eq (default "pvc" $persistence.type) "pvc" }} | ||||
|     {{- $pvcName := (include "common.names.fullname" $) -}} | ||||
|     {{- if $persistence.existingClaim }} | ||||
|       {{- /* Always prefer an existingClaim if that is set */}} | ||||
|       {{- $pvcName = $persistence.existingClaim -}} | ||||
|     {{- else -}} | ||||
|       {{- /* Otherwise refer to the PVC name */}} | ||||
|       {{- if $persistence.nameOverride -}} | ||||
|         {{- if not (eq $persistence.nameOverride "-") -}} | ||||
|           {{- $pvcName = (printf "%s-%s" (include "common.names.fullname" $) $persistence.nameOverride) -}} | ||||
|         {{- end -}} | ||||
|       {{- else -}} | ||||
|         {{- $pvcName = (printf "%s-%s" (include "common.names.fullname" $) $index) -}} | ||||
|       {{- end -}} | ||||
|     {{- end }} | ||||
|   persistentVolumeClaim: | ||||
|     claimName: {{ $pvcName }} | ||||
|   {{- else if or (eq $persistence.type "configMap") (eq $persistence.type "secret") }} | ||||
|     {{- $objectName := (required (printf "name not set for persistence item %s" $index) $persistence.name) }} | ||||
|     {{- $objectName = tpl $objectName $ }} | ||||
|     {{- if eq $persistence.type "configMap" }} | ||||
|   configMap: | ||||
|     name: {{ $objectName }} | ||||
|     {{- else }} | ||||
|   secret: | ||||
|     secretName: {{ $objectName }} | ||||
|     {{- end }} | ||||
|     {{- with $persistence.defaultMode }} | ||||
|     defaultMode: {{ . }} | ||||
|     {{- end }} | ||||
|     {{- with $persistence.items }} | ||||
|     items: | ||||
|       {{- toYaml . | nindent 6 }} | ||||
|     {{- end }} | ||||
|   {{- else if eq $persistence.type "emptyDir" }} | ||||
|     {{- $emptyDir := dict -}} | ||||
|     {{- with $persistence.medium -}} | ||||
|       {{- $_ := set $emptyDir "medium" . -}} | ||||
|     {{- end -}} | ||||
|     {{- with $persistence.sizeLimit -}} | ||||
|       {{- $_ := set $emptyDir "sizeLimit" . -}} | ||||
|     {{- end }} | ||||
|   emptyDir: {{- $emptyDir | toYaml | nindent 4 }} | ||||
|   {{- else if eq $persistence.type "hostPath" }} | ||||
|   hostPath: | ||||
|     path: {{ required "hostPath not set" $persistence.hostPath }} | ||||
|     {{- with $persistence.hostPathType }} | ||||
|     type: {{ . }} | ||||
|     {{- end }} | ||||
|   {{- else if eq $persistence.type "custom" }} | ||||
|     {{- toYaml $persistence.volumeSpec | nindent 2 }} | ||||
|   {{- else }} | ||||
|     {{- fail (printf "Not a valid persistence.type (%s)" .Values.persistence.type) }} | ||||
|   {{- end }} | ||||
| {{- end }} | ||||
| {{- end }} | ||||
| {{- end }} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue