feat: create tls certificate if tls is enabled and the app has domains

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-01-23 03:00:27 -05:00
1 parent b0485495e4
commit 63a6e9087f
6 files changed
+227 -26

No files matched your search

+19
View File
@@ -395,6 +395,9 @@ data:
}
}
// todo: make this configurable
tls := false
domains := []string{}
if deployment, ok := deployments["web"]; ok {
service := templateKubernetesService(Service{
@@ -439,6 +442,21 @@ data:
if err != nil {
return fmt.Errorf("Error creating ingress routes: %w", err)
}
err = createCertificateFile(CreateCertificateFileInput{
ChartDir: chartDir,
Certificate: Certificate{
AppName: appName,
Name: fmt.Sprintf("%s-%s", appName, "web"),
Namespace: namespace,
TLS: tls,
},
IssuerName: "letsencrypt-prod",
ProcessType: "web",
})
if err != nil {
return fmt.Errorf("Error creating certificate files: %w", err)
}
}
chart := &Chart{
@@ -468,6 +486,7 @@ data:
if processType == "web" {
sort.Strings(domains)
processValues.Domains = domains
processValues.TLS = tls
}
values.Processes[processType] = processValues