fix: ensure the ingress class is properly set for certificate usage

Without this, switching to nginx ingress fails as the cluster issuer isn't properly configured
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-12 01:30:17 -05:00
parent 433eb26f3c
commit abbc13cb85
2 changed files with 12 additions and 10 deletions

View File

@@ -149,16 +149,18 @@ func applyClusterIssuers(ctx context.Context) error {
clusterIssuerValues := ClusterIssuerValues{
ClusterIssuers: map[string]ClusterIssuer{
"letsencrypt-stag": {
Email: letsencryptEmailStag,
Enabled: letsencryptEmailStag != "",
Name: "letsencrypt-stag",
Server: "https://acme-staging-v02.api.letsencrypt.org/directory",
Email: letsencryptEmailStag,
Enabled: letsencryptEmailStag != "",
IngressClass: getGlobalIngressClass(),
Name: "letsencrypt-stag",
Server: "https://acme-staging-v02.api.letsencrypt.org/directory",
},
"letsencrypt-prod": {
Email: letsencryptEmailProd,
Enabled: letsencryptEmailProd != "",
Name: "letsencrypt-prod",
Server: "https://acme-v02.api.letsencrypt.org/directory",
Email: letsencryptEmailProd,
Enabled: letsencryptEmailProd != "",
IngressClass: getGlobalIngressClass(),
Name: "letsencrypt-prod",
Server: "https://acme-v02.api.letsencrypt.org/directory",
},
},
}
@@ -496,7 +498,7 @@ func getComputedImagePullSecrets(appName string) string {
}
func getGlobalIngressClass() string {
return common.PropertyGetDefault("scheduler-k3s", "global", "ingress-class", DefaultIngressClass)
return common.PropertyGetDefault("scheduler-k3s", "--global", "ingress-class", DefaultIngressClass)
}
func getIngressAnnotations(appName string, processType string) (map[string]string, error) {

View File

@@ -351,7 +351,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
},
Namespace: namespace,
Network: GlobalNetwork{
IngressClass: common.PropertyGetDefault("scheduler-k3s", "--global", "ingress-class", DefaultIngressClass),
IngressClass: getGlobalIngressClass(),
PrimaryPort: primaryPort,
},
Secrets: map[string]string{},