fix: correct issues in certificate generation

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-23 06:18:25 -05:00
parent a9e6e96697
commit c8f5ad9029
3 changed files with 8 additions and 6 deletions

View File

@@ -108,7 +108,7 @@ const (
type ProcessWeb struct { type ProcessWeb struct {
Domains []string `yaml:"domains,omitempty"` Domains []string `yaml:"domains,omitempty"`
PortMaps []ProcessPortMap `yaml:"port_maps,omitempty"` PortMaps []ProcessPortMap `yaml:"port_maps,omitempty"`
TLS bool `yaml:"tls"` TLS ProcessTls `yaml:"tls"`
} }
type ProcessResourcesMap struct { type ProcessResourcesMap struct {

View File

@@ -1,6 +1,6 @@
{{- $processName := "PROCESS_NAME" }} {{- $processName := "PROCESS_NAME" }}
{{- $config := .Values.processes.PROCESS_NAME }} {{- $config := .Values.processes.PROCESS_NAME }}
{{- if and $config.web.tls $config.domains }} {{- if and $config.web.tls.enabled $config.web.domains }}
--- ---
apiVersion: cert-manager.io/v1 apiVersion: cert-manager.io/v1
kind: Certificate kind: Certificate
@@ -16,7 +16,7 @@ metadata:
spec: spec:
issuerRef: issuerRef:
kind: ClusterIssuer kind: ClusterIssuer
name: {{ $config.tls.issuer_name }} name: {{ $config.web.tls.issuer_name }}
secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }} secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }}
secretTemplate: secretTemplate:
annotations: annotations:
@@ -24,9 +24,8 @@ spec:
labels: labels:
app.kubernetes.io/name: {{ $.Values.global.app_name }}-{{ $processName }} app.kubernetes.io/name: {{ $.Values.global.app_name }}-{{ $processName }}
app.kubernetes.io/part-of: {{ $.Values.global.app_name }} app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
status: {}
dnsNames: dnsNames:
{{- range $config.domains }} {{- range $config.web.domains }}
- {{ . }} - {{ . }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -378,7 +378,10 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
processValues.Web = ProcessWeb{ processValues.Web = ProcessWeb{
Domains: domains, Domains: domains,
PortMaps: []ProcessPortMap{}, PortMaps: []ProcessPortMap{},
TLS: tls, TLS: ProcessTls{
Enabled: tls,
IssuerName: issuerName,
},
} }
processValues.ProcessType = ProcessType_Web processValues.ProcessType = ProcessType_Web
for _, portMap := range portMaps { for _, portMap := range portMaps {