Simplify ingress_secret_name setting and add ingress_labels setting

using std.objectHas() removes the need to have a separate boolean to check.
pull/178/head
HubbeKing 4 years ago
parent cf7670d008
commit 4ca425dd12

@ -47,9 +47,11 @@
// Set to true to let the ingress handle TLS // Set to true to let the ingress handle TLS
ingress_tls: true, ingress_tls: true,
// Set to true and give a secretName for ingress, if required for ingress TLS // Uncomment and give a secretName for ingress, if required for ingress TLS
ingress_secret_name_needed: false, //ingress_secret_name: "wubloader-tls",
ingress_secret_name: "wubloader-tls",
// Additional metadata labels for Ingress (cert-manager, etc.) - uncomment if needed, adjust as necessary
//ingress_labels: {"cert-manager.io/cluster-issuer": "name-of-issuer"},
// Connection args for the database. // Connection args for the database.
// If database is defined in this config, host and port should be postgres:5432. // If database is defined in this config, host and port should be postgres:5432.
@ -208,7 +210,7 @@
apiVersion: "networking.k8s.io/v1beta1", apiVersion: "networking.k8s.io/v1beta1",
metadata: { metadata: {
name: "wubloader", name: "wubloader",
labels: {app: "wubloader"}, labels: {app: "wubloader"} + (if (std.objectHas($.config, "ingress_labels")) then $.config.ingress_labels else {}),
}, },
spec: { spec: {
rules: [ rules: [
@ -244,7 +246,7 @@
hosts: [ hosts: [
$.config.ingress_host, $.config.ingress_host,
], ],
[if ($.config.ingress_secret_name_needed) then 'secretName']: $.config.ingress_secret_name, [if (std.objectHas($.config, "ingress_secret_name")) then 'secretName']: $.config.ingress_secret_name,
}, },
], ],
}, },

Loading…
Cancel
Save