*/kube: Add kube.SimpleIngress
Change-Id: Iddcac629b9938f228dd93b32e58bb14606d5c6e5
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1745
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/personal/q3k/annoyatron/prod.jsonnet b/personal/q3k/annoyatron/prod.jsonnet
index c693cfd..84f2f6e 100644
--- a/personal/q3k/annoyatron/prod.jsonnet
+++ b/personal/q3k/annoyatron/prod.jsonnet
@@ -1,4 +1,4 @@
-local kube = import '../../../kube/kube.libsonnet';
+local kube = import '../../../kube/hscloud.libsonnet';
{
local annoyatron = self,
local cfg = self.cfg,
@@ -46,28 +46,11 @@
],
},
},
- ingress: kube.Ingress("annoyatron") {
+ ingress: kube.SimpleIngress("annoyatron") {
metadata+: {
namespace: "q3k",
- annotations+: {
- "kubernetes.io/tls-acme": "true",
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
- },
},
- spec+: {
- tls: [
- { hosts: [cfg.domain], secretName: "annoyatron-tls" },
- ],
- rules: [
- {
- host: cfg.domain,
- http: {
- paths: [
- { path: "/", backend: annoyatron.svc.name_port },
- ],
- },
- }
- ],
- },
+ hosts:: [cfg.domain],
+ target_service:: annoyatron.svc,
},
}
diff --git a/personal/q3k/ppsa.jsonnet b/personal/q3k/ppsa.jsonnet
index 60651c7..c5bf90a 100644
--- a/personal/q3k/ppsa.jsonnet
+++ b/personal/q3k/ppsa.jsonnet
@@ -1,4 +1,4 @@
-local kube = import "../../kube/kube.libsonnet";
+local kube = import "../../kube/hscloud.libsonnet";
{
local top = self,
@@ -33,29 +33,8 @@
svc: top.ns.Contain(kube.Service("ppsa-jsonapi")) {
target_pod:: top.deploy.spec.template,
},
- ingress: top.ns.Contain(kube.Ingress("ppsa-jsonapi")) {
- metadata+: {
- annotations+: {
- "kubernetes.io/tls-acme": "true",
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
- "nginx.ingress.kubernetes.io/proxy-body-size": "0",
- },
- },
- spec+: {
- tls: [
- { hosts: [ "ppsa.app.q3k.org"], secretName: "ppsa-jsonapi-tls", },
- ],
- rules: [
- {
- host: "ppsa.app.q3k.org",
- http: {
- paths: [
- { path: "/", backend: top.svc.name_port },
- ],
- },
- },
- ],
- },
+ ingress: top.ns.Contain(kube.SimpleIngress("ppsa-jsonapi")) {
+ hosts:: ["ppsa.app.q3k.org"],
+ target_service:: top.svc,
},
-
}
diff --git a/personal/q3k/rc3.jsonnet b/personal/q3k/rc3.jsonnet
index 91f3969..b4112f2 100644
--- a/personal/q3k/rc3.jsonnet
+++ b/personal/q3k/rc3.jsonnet
@@ -1,4 +1,4 @@
-local kube = import "../../kube/kube.libsonnet";
+local kube = import "../../kube/hscloud.libsonnet";
{
local rc3 = self,
@@ -32,29 +32,11 @@
},
target_pod:: rc3.deploy.spec.template,
},
- ingress: kube.Ingress("rc3-data") {
+ ingress: kube.SimpleIngress("rc3-data") {
metadata+: {
namespace: "personal-q3k",
- annotations+: {
- "kubernetes.io/tls-acme": "true",
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
- "nginx.ingress.kubernetes.io/proxy-body-size": "0",
- },
},
- spec+: {
- tls: [
- { hosts: [ "rc3-data.q3k.org"], secretName: "rc3-data-tls", },
- ],
- rules: [
- {
- host: "rc3-data.q3k.org",
- http: {
- paths: [
- { path: "/", backend: rc3.svc.name_port },
- ],
- },
- },
- ],
- },
+ hosts:: ["rc3-data.q3k.org"],
+ target_service:: rc3.svc,
},
}
diff --git a/personal/q3k/wow/lib.libsonnet b/personal/q3k/wow/lib.libsonnet
index d9ddc3d..03127e9 100644
--- a/personal/q3k/wow/lib.libsonnet
+++ b/personal/q3k/wow/lib.libsonnet
@@ -1,4 +1,4 @@
-local kube = import "../../../kube/kube.libsonnet";
+local kube = import "../../../kube/hscloud.libsonnet";
{
local wow = self,
@@ -272,30 +272,8 @@
],
},
},
- panelIngress: ns.Contain(kube.Ingress(cfg.prefix + "panel")) {
- metadata+: {
- annotations+: {
- "kubernetes.io/tls-acme": "true",
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
- },
- },
- spec+: {
- tls: [
- {
- hosts: [cfg.panel.domain],
- secretName: cfg.prefix + "panel-tls",
- },
- ],
- rules: [
- {
- host: cfg.panel.domain,
- http: {
- paths: [
- { path: "/", backend: wow.panelSvc.name_port },
- ],
- },
- }
- ],
- },
+ panelIngress: ns.Contain(kube.SimpleIngress(cfg.prefix + "panel")) {
+ hosts:: [cfg.panel.domain],
+ target_service:: wow.panelSvc,
},
}