feat: add support to tls for ingress-route
If tls is enabled on the process, we create add the https entrypoint and also add the requisite tls secret-name
This commit is contained in:
1 parent
63a6e9087f
commit
29760e8ecd
2 files changed
+9
-7
No files matched your search
@@ -86,7 +86,7 @@ func createIngressRoutesFiles(input CreateIngressRoutesInput) error {
|
|||||||
return fmt.Errorf("Error reading ingress route append file: %w", err)
|
return fmt.Errorf("Error reading ingress route append file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
contents := string(bytes.Join([][]byte{b, append}, []byte("")))
|
contents := strings.Join([]string{strings.TrimSpace(string(b)), string(append)}, "")
|
||||||
contents = strings.ReplaceAll(contents, " routes: null", "")
|
contents = strings.ReplaceAll(contents, " routes: null", "")
|
||||||
contents = strings.Join([]string{
|
contents = strings.Join([]string{
|
||||||
"{{- if .Values.processes.PROCESS_TYPE.domains }}",
|
"{{- if .Values.processes.PROCESS_TYPE.domains }}",
|
||||||
@@ -731,11 +731,6 @@ type IngressRoute struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func templateKubernetesIngressRoute(input IngressRoute) traefikv1alpha1.IngressRoute {
|
func templateKubernetesIngressRoute(input IngressRoute) traefikv1alpha1.IngressRoute {
|
||||||
entryPoint := IngressRouteEntrypoint_HTTP
|
|
||||||
if input.PortMap.Scheme == "https" {
|
|
||||||
entryPoint = IngressRouteEntrypoint_HTTPS
|
|
||||||
}
|
|
||||||
|
|
||||||
labels := map[string]string{
|
labels := map[string]string{
|
||||||
"app.kubernetes.io/instance": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType),
|
"app.kubernetes.io/instance": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType),
|
||||||
"app.kubernetes.io/name": input.ProcessType,
|
"app.kubernetes.io/name": input.ProcessType,
|
||||||
@@ -754,7 +749,7 @@ func templateKubernetesIngressRoute(input IngressRoute) traefikv1alpha1.IngressR
|
|||||||
Annotations: annotations,
|
Annotations: annotations,
|
||||||
},
|
},
|
||||||
Spec: traefikv1alpha1.IngressRouteSpec{
|
Spec: traefikv1alpha1.IngressRouteSpec{
|
||||||
EntryPoints: []string{string(entryPoint)},
|
EntryPoints: []string{string(IngressRouteEntrypoint_HTTP)},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
{{ if .Values.processes.PROCESS_TYPE.tls }}
|
||||||
|
- websecure
|
||||||
|
{{- end }}
|
||||||
routes:
|
routes:
|
||||||
{{- range .Values.processes.PROCESS_TYPE.domains }}
|
{{- range .Values.processes.PROCESS_TYPE.domains }}
|
||||||
- kind: Rule
|
- kind: Rule
|
||||||
@@ -9,3 +12,7 @@
|
|||||||
port: PORT_MAPPING
|
port: PORT_MAPPING
|
||||||
scheme: PORT_SCHEME
|
scheme: PORT_SCHEME
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{ if .Values.processes.PROCESS_TYPE.tls }}
|
||||||
|
tls:
|
||||||
|
secretName: tls-APP_NAME-PROCESS_TYPE
|
||||||
|
{{- end }}
|
||||||
Reference in new issue
Block a user