1
0
Fork 0
mirror of https://git.sr.ht/~goorzhel/turboprop synced 2024-12-14 11:37:37 +00:00
Commit graph

258 commits

Author SHA1 Message Date
Antonio Gurgel
f75c9aa476 Add API-gatherer 2023-11-20 20:51:34 -08:00
Antonio Gurgel
20aa7ee6d6 Make app-template builders apiVersion-aware 2023-11-20 19:31:14 -08:00
Antonio Gurgel
2d50b59e74 Write more comments
Some of these will become part of README.md later.
2023-11-20 00:18:27 -08:00
Antonio Gurgel
528e6e7fb1 Fix logic error in mkSimpleHTTPRoute
Parent ref should use svcGateway's NS, not service's.
2023-11-19 23:51:32 -08:00
Antonio Gurgel
e5ff9ec805 Factor out pname from main derivation 2023-11-19 14:24:35 -08:00
Antonio Gurgel
708e537c7c Remove verbs from lib.{build,fetch}ers.*
Reading things like `lib.builders.buildHelmChart` got exhausting.
2023-11-19 14:24:24 -08:00
Antonio Gurgel
d0f61ec7de Add Makefile and helper for decrypting SOPS secrets 2023-11-19 13:44:34 -08:00
Antonio Gurgel
33433a953e Build namespaces
I initially thought this would be just another release in
`releases/common/namespaces`, but there's a lot more potential
than that.
2023-11-19 13:21:41 -08:00
Antonio Gurgel
6e09298a02 Tidy up 2023-11-19 11:46:27 -08:00
Antonio Gurgel
46ec341d3e Make app-template lib kebab-case
To reduce collisions with lib.eureka.appTemplate, and because
bjw-s' chart and the Nix module for it are both kebab-case.
2023-11-19 11:39:39 -08:00
Antonio Gurgel
408befb503 Decouple homelab idiosyncrasies
My long-term vision for this flake is to use it as a control flake:
plug it into your homelab ("data-plane") flake and avail yourself
of its `lib.builders`, et cetera.

In short, I want this flake to be useful to many people, and that
means not shipping my homelab with it.
2023-11-19 11:35:35 -08:00
Antonio Gurgel
e211b78331 Document why I didn't act on the note I wrote in bed
"Flake builder for charts could also take {fetcher, args}."

Except it shouldn't, because then I'll be peppering 98% of the modules
in `charts/` with `fetcher = lib.fetchers.helmChart`. Better to spend
a constant 100..150 chars on an extra flake-builder (fetchCharts) than
n*(30..50) chars on a refactor.
2023-11-19 11:11:22 -08:00
Antonio Gurgel
9d9808e97a Remove variadity from release modules
It's possible I'll regret this later, but for now there's no reason to
pass anything other than `lib` into the releases.

Okay, _now_ I'll go to bed.
2023-11-18 23:51:09 -08:00
Antonio Gurgel
7443323ebb Last bout of refactoring before bed
- Moved external ServiceEntry generator to `lib.resources`.
- Gave it some company: a generator of HTTPRoutes for gateway/svc.
- Gave `lib.vars.svcGateway` a parentRef generator, at the cost of
  another level of recursion, and some variable renaming.
2023-11-18 23:45:45 -08:00
Antonio Gurgel
a74676d5f8 Factor out derivation-collecting 2023-11-18 23:22:51 -08:00
Antonio Gurgel
7082240db6 Simplify setNsOnObjects
`objs` is passed verbatim, so just leave it implied.
2023-11-18 23:22:31 -08:00
Antonio Gurgel
2c213d6222 Factor out (and document exhaustively) flake-builders 2023-11-18 23:13:11 -08:00
Antonio Gurgel
cc159c6ff9 Forgot to git rm an unused YAML 2023-11-18 22:39:25 -08:00
Antonio Gurgel
f62420754a Lower all of lib's imports into named attrs
The namespace was getting a bit crowded.
2023-11-18 22:38:17 -08:00
Antonio Gurgel
18b3cbfe84 Remove kubelib as release input; rm buildYAMLStream synonym
Everything I need directly from nix-kube-generators is now
handled in `lib/`. Additionally, now that I know buildYAMLStream always
takes a namespace and name, there's no need for the longer-winded name.
2023-11-18 22:21:08 -08:00
Antonio Gurgel
367851267f Split fetchers and builders; create NamespacedYAML builder
The reason I struggled with genericBuilders, and again when I replaced
`remoteYAML`'s NS-name `pname` with `url`, is that I was confusing the
following two things:
1. Things that fetch a resource (a Helm chart, a YAML stream, etc.)
without naming or namespacing it.
2. Things that create a release _by_ giving it a name and namespace
so that lib/output.sh can sort the resultant files into directories.

Additionally, I was questioning the good sense of releases/svc/gateway:
a release with no release, but only extra objects? Turns out I
needlessly bound the concept of JIT namespace injection to that
`extraObjects` feature. Once I abstracted that builder, the more general
solution became clear.
2023-11-18 22:01:43 -08:00
Antonio Gurgel
666f822bc1 Get rid of genericBuilder; use URLs in drvs of fetched charts
genericBuilder didn't make much sense to begin with.
2023-11-18 20:44:45 -08:00
Antonio Gurgel
c02685125d Move gitChart back to lib/builders
I probably took it out because I struggled with fitting it into
genericBuilder, but gitChart really does belong there.
2023-11-18 20:24:13 -08:00
Antonio Gurgel
c8bb79b599 Create Istio SE for Breezewiki 2023-11-18 20:23:47 -08:00
Antonio Gurgel
e6ef6e90ef Factor out Istio ServiceEntries
I have a handful in my cluster, and they're all lists of HTTPS domains.
2023-11-18 20:12:17 -08:00
Antonio Gurgel
ddbb86de38 Forgot config volume for Jellyfin 2023-11-18 20:02:22 -08:00
Antonio Gurgel
1e90084158 Run Jellyfin as nfs U/GID 2023-11-18 20:00:47 -08:00
Antonio Gurgel
6e38e657fa Simplify Jellyfin's spec
I forgot I could go back to specifying it like this after learning of
recursive attrset updates.
2023-11-18 19:25:47 -08:00
Antonio Gurgel
b97c0cd007 Don't use dir name in .#packages.*.default
https://nix.dev/guides/best-practices#reproducible-source-paths
2023-11-18 19:22:25 -08:00
Antonio Gurgel
4b86013c58 Simplify main image argument
I'm trying to _reduce_ boilerplate, not create it.
2023-11-18 19:22:25 -08:00
Antonio Gurgel
9d888486c1 Learn recursive updates
Turns out `//` is more destructive than I thought. With it,
I was wiping `metadata` of everything but the `namespace` key.
2023-11-18 19:22:25 -08:00
Antonio Gurgel
8d355af50d Convert releases/svc/gateway to extraObjects
Now that I have the auto-namespace thing I can skip passing `namespace`
into this module too.
2023-11-18 19:22:25 -08:00
Antonio Gurgel
b51bcafdaf Implement attaching extra k8s objects to releases
No more tossing YAMLs into release dirs. All is Nix.
2023-11-18 19:22:25 -08:00
Antonio Gurgel
11a3fcb002 Refactor modules
By declaring builders at the module level, only to call them in
flake.nix, I give myself the opportunity to inject `{name, namespace}`
there and need no longer pass these args into every module myself.
2023-11-18 19:22:25 -08:00
Antonio Gurgel
293fdfe41b Use null to indicate null hostname in Gateway 2023-11-18 15:33:42 -08:00
Antonio Gurgel
0e7b254676 Rename lib.yamlFile; make stream builder
And the module still doesn't build at this comment. Things are getting
very complicated.
2023-11-18 15:32:08 -08:00
Antonio Gurgel
e0907193ba rm lib.getValues
I'm no longer doing Helm values in YAML.
2023-11-18 14:25:39 -08:00
Antonio Gurgel
47d496a9a6 Learn to use recursive attrsets 2023-11-18 14:25:39 -08:00
Antonio Gurgel
7609f8624a Add gtw/svc; refactor vars.svcGateway 2023-11-18 14:25:37 -08:00
Antonio Gurgel
fadab2d696 Make simpleHTTPRoute function signature consistent 2023-11-18 13:36:48 -08:00
Antonio Gurgel
048437e884 Fix silly typos from b7560b and 056046
I misspelled `svcGatewayName` and bungled the assignment of
`containers.main.image.tag`.
2023-11-18 13:36:48 -08:00
Antonio Gurgel
6375c3e9ab Add Jellyfin 2023-11-18 13:36:48 -08:00
Antonio Gurgel
ac3af9a823 Use mainImage in sota-slack-spotter
Nothing else to factor out from there; believe me, I've checked...
2023-11-18 02:36:08 -08:00
Antonio Gurgel
b7560fb29e Remove string-format fumbling from lib.mainImage
I can't imagine a time `repoDomain` would ever be unset.
(Yeah, docker.io, that means you too.)
2023-11-18 02:35:02 -08:00
Antonio Gurgel
e122d7addb rm unused values files 2023-11-18 02:34:17 -08:00
Antonio Gurgel
e22c63f673 Factor out using existing PVCs 2023-11-18 02:29:24 -08:00
Antonio Gurgel
0405524191 Organize lib/vars; don't hard-code Gateway name 2023-11-18 02:20:55 -08:00
Antonio Gurgel
2ccc03bde6 Factor out app-template main container image 2023-11-18 02:19:19 -08:00
Antonio Gurgel
4a86b9a6d6 Missed a spot
I forgot upstream's default value for `route.main.enabled` is false.

And here I only had to change it IN ONE PLACE. This is truly the future.
2023-11-18 02:10:03 -08:00
Antonio Gurgel
05604660ea Factor out app-template HTTPRoutes 2023-11-18 02:09:30 -08:00