Update ingress manifest to networking.k8s.io/v1 API

This means k8s.jsonnet only works with kubernetes versions >= 1.19.0, but means it works with kubernetes versions >= 1.22.0 as well, which removed the old networking.k8s.io/v1beta API.
pull/237/head
HubbeKing 3 years ago committed by Mike Lang
parent e4c8d4eef0
commit 08a4f8f53e

@ -62,6 +62,9 @@
// Set to true to let the ingress handle TLS // Set to true to let the ingress handle TLS
ingress_tls: true, ingress_tls: true,
// Ingress class for ingress
ingress_class_name: "nginx",
// Uncomment 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: "wubloader-tls", //ingress_secret_name: "wubloader-tls",
@ -308,12 +311,13 @@
// Ingress to direct requests to the correct services. // Ingress to direct requests to the correct services.
{ {
kind: "Ingress", kind: "Ingress",
apiVersion: "networking.k8s.io/v1beta1", apiVersion: "networking.k8s.io/v1",
metadata: { metadata: {
name: "wubloader", name: "wubloader",
labels: {app: "wubloader"} + $.config.ingress_labels, labels: {app: "wubloader"} + $.config.ingress_labels,
}, },
spec: { spec: {
ingressClassName: $.config.ingress_class_name,
rules: [ rules: [
{ {
host: $.config.ingress_host, host: $.config.ingress_host,
@ -323,8 +327,12 @@
path: path, path: path,
pathType: type, pathType: type,
backend: { backend: {
serviceName: "wubloader-%s" % std.strReplace(name, "_", "-"), service: {
servicePort: 80, name: "wubloader-%s" % std.strReplace(name, "_", "-"),
port: {
number: 80
},
},
}, },
}, },
local metric_rule(name) = rule(name, "/metrics/%s" % name, "Exact"), local metric_rule(name) = rule(name, "/metrics/%s" % name, "Exact"),

Loading…
Cancel
Save