Add an ability to install ingress
This commit is contained in:
		@@ -2,7 +2,7 @@ apiVersion: v2
 | 
			
		||||
name: softplayer-lib-workload
 | 
			
		||||
description: A library to be reused accross softplayer charts
 | 
			
		||||
type: library
 | 
			
		||||
version: 0.1.8
 | 
			
		||||
version: 0.2.0
 | 
			
		||||
maintainers:
 | 
			
		||||
  - name: allanger
 | 
			
		||||
    email: allanger@badhouseplants.net
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								charts/workload/templates/ingress/_ingresses.tpl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								charts/workload/templates/ingress/_ingresses.tpl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
{{- define "lib.ingress" }}
 | 
			
		||||
{{- range $k, $v := .Values.ingress }}
 | 
			
		||||
{{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }}
 | 
			
		||||
{{- if $v.annotations -}}
 | 
			
		||||
{{- $annotations := $v.annotations }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- $annotations := "" }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
---
 | 
			
		||||
# ---------------------------------------------------------------------
 | 
			
		||||
# This ingress is created as a part of softplayer helm library
 | 
			
		||||
# please see /lib/tempaltes/ingress/_ingress.tpl
 | 
			
		||||
# ---------------------------------------------------------------------
 | 
			
		||||
apiVersion: networking.k8s.io/v1
 | 
			
		||||
kind: Ingress
 | 
			
		||||
metadata:
 | 
			
		||||
{{- include "lib.metadata" (dict "Context" $ "customName" $customName "annotations" $v.annotations)}}
 | 
			
		||||
spec:
 | 
			
		||||
  ingressClassName: $v.class
 | 
			
		||||
  rules:
 | 
			
		||||
  {{- with $v.rules }}
 | 
			
		||||
    {{- tpl ( . | toYaml | nindent 4 | toString) $  }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with $v.tls }}
 | 
			
		||||
    {{- tpl ( . | toYaml | nindent 4 | toString) $  }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
@@ -7,6 +7,10 @@ metadata:
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  labels:
 | 
			
		||||
{{ include "metadata.labels" .Context | indent 4 }}
 | 
			
		||||
  {{- if .annotations }}
 | 
			
		||||
  annotations:
 | 
			
		||||
{{ .annotations | toYaml | indent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{- define "metadata.customName" -}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user