| local kube = import "../../kube/hscloud.libsonnet"; |
| |
| { |
| local top = self, |
| local cfg = self.cfg, |
| |
| cfg:: { |
| name: 'site', |
| namespace: 'site', |
| domains: [ |
| 'new.hackerspace.pl', |
| ], |
| image: 'registry.k0.hswaw.net/q3k/hswaw-site@sha256:02414c9e7e0751abe7a8ad3ef1b1ccc35f1f89edf67a6f0b396b7a1d0c178f2b', |
| }, |
| |
| ns: kube.Namespace(cfg.namespace), |
| |
| deployment: top.ns.Contain(kube.Deployment(cfg.name)) { |
| spec+: { |
| replicas: 3, |
| template+: { |
| spec+: { |
| containers_: { |
| default: kube.Container("default") { |
| image: cfg.image, |
| command: [ |
| "/hswaw/site/site", |
| "-logtostderr", |
| ], |
| resources: { |
| requests: { cpu: "25m", memory: "64Mi" }, |
| limits: { cpu: "500m", memory: "128Mi" }, |
| }, |
| ports_: { |
| http: { containerPort: 8080 }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| |
| service: top.ns.Contain(kube.Service(cfg.name)) { |
| target_pod:: top.deployment.spec.template, |
| }, |
| |
| ingress: top.ns.Contain(kube.SimpleIngress(cfg.name)) { |
| hosts:: cfg.domains, |
| target_service:: top.service, |
| }, |
| } |