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

115 commits

Author SHA1 Message Date
Antonio Gurgel
d6c9c75891 Parametrize, exhaustively document flattenTree 2024-08-10 12:45:51 -07:00
Antonio Gurgel
4956f2f769 Fix some comment typos and misphrasings 2024-08-10 12:43:30 -07:00
Antonio Gurgel
813e933d96 Move liftDefault closer to place of use 2024-08-07 20:20:48 -07:00
Antonio Gurgel
a107476ca1 Don't set Kustomization ns if >1 of them present
Cleaner resolution for the problem mentioned last commit.
Fixes mono-namespace charts while assuming multi-namespace charts
have the diligence to set `.metadata.namespace` everywhere necessary.
2024-07-21 19:59:21 -07:00
Antonio Gurgel
71fcfe16a4 Set resource ns in Kustomization, not chart itself
This restores the derivation ancestry lost when forcing the chart
through `yamlStream`.
2024-05-21 18:55:18 -07:00
Antonio Gurgel
f8d8120e40 Support extraOpts in lib.app-template.build 2024-04-09 21:36:33 -07:00
Antonio Gurgel
b90ffcace4 Use nixhelm as input; rework AT and lib interface
In 0fb8e4d I forgot that flake input-following exists. I don't _have_ to
ship nixhelm myself, but I do need to include it so I can stop bundling
data for an oudated AT version.

In fact, I need not bundle _anything_ for the AT library to be useful;
it's better to make the builder's `chart` arg mandatory and let the user
supply their own (usually taken from nixhelm). If they get bored of
supplying the chart to every AT instance they can factor it out,
as I have in my own deployment.

In fact, my deployment relies on the AT library, which I used to provide
as a flake output -- but it didn't make sense to have one version of the
turboprop library available inside service definitions and another
available outside. So I've made the whole library a flake output.
This may bite me in the future.
2024-02-18 20:56:48 -08:00
Antonio Gurgel
e21a3f037f Give into recursion 2024-02-17 01:23:07 -08:00
Antonio Gurgel
104cc71f0e Parametrize app-template chart
I was unwisely locking downstream flakes into a specific version of AT.
2024-02-17 01:22:57 -08:00
Antonio Gurgel
948e4aaf8a Clean up comments 2024-02-17 01:22:29 -08:00
Antonio Gurgel
27b06c5798 Implement lib.gatherNamespaces
The documentation for pkgs.lib.lists.unique warned me that the function
is O(n^2). So I conducted some rather unscientific tests using my own
Kubernetes flake and found no noticeable time penalty:
`rm result && nix-collect-garbage -d && nix build` always took
between 37 and 40 seconds, with or without gatherNamespaces.
But, well, n=10.

Also, make more obvious the flaw in mk.namespaces.
If I prefix something with "N.B." it shouldn't be hidden in the code.
2023-12-07 00:03:08 -08:00
Antonio Gurgel
96ab10c070 Document flattenTree better 2023-12-06 22:59:39 -08:00
Antonio Gurgel
a6ab0c6960 Allow fetchers to be used as builders
Another interface oddity cut down. I shouldn't have to make
two derivations (lib.builders.derivation) for one file.
2023-12-06 00:00:05 -08:00
Antonio Gurgel
9e7bac64c8 Move app-template back to lib
This interface was getting ridiculous.

`app-template` gets released infrequently enough that keeping a static
`chart.nix` is a small tradeoff for the previous lunacy of passing a
whole derivation tree in through the flake.
2023-12-05 22:46:47 -08:00
Antonio Gurgel
a32b24c69a Lift only modules named default
Otherwise `services/default` obliterates everything at its level.
2023-12-04 22:57:52 -08:00
Antonio Gurgel
0f7f384137 Create mkChartsWithNixhelm; export appT 2023-12-03 23:03:36 -08:00
Antonio Gurgel
3a6246ab83 Final refactor
Make flake importable at top level.
Move app-template to `./src`, removing `charts` from `./lib`.
Clean up unused bits elsewhere.
2023-12-03 21:45:40 -08:00
Antonio Gurgel
6907ae7373 Clean up 2023-12-03 21:29:15 -08:00
Antonio Gurgel
ec3276b493 Truck in user data from own flake
Same rationale as 0790be8.
2023-12-03 20:03:13 -08:00
Antonio Gurgel
97dbdec7f7 Re-implement service-builder
`apiVersions` gave me a headache while writing the foldl so I made it
a separate input.

Now the service modules have this signature, without my having to
change any code in the modules themselves:

{charts, etc, ...} -> [apiVersion] -> {out, extra}
2023-12-03 19:58:28 -08:00
Antonio Gurgel
6b97777fe9 Typo 2023-12-03 18:02:47 -08:00
Antonio Gurgel
6bbd867da3 Experimentally implement mkStages 2023-12-03 18:01:06 -08:00
Antonio Gurgel
797ae401ae Truck in haumea 2023-12-03 17:07:21 -08:00
Antonio Gurgel
70fae512d1 Refactor crisis
Two imperfections have come to bite me simultaneously:
- I wanted strict ordering of services but implemented it very sloppily.
- The flake builders represent implementation leakage. I want to present
  a clean interface to users, not "first, you must evaluate these
  twenty-eight variables".

So now I'm fixing too many things at once. Luckily it's hard to lose
things in Git.
2023-11-29 23:06:13 -08:00
Antonio Gurgel
742612a9d7 rm alwaysList
https://github.com/farcaller/nix-kube-generators/pull/6
2023-11-27 11:40:13 -08:00
Antonio Gurgel
84b62768b4 Add flake-builder input for user data
I stowed my particularities in lib.eureka, but exporting
`packages.*.flakeBuilders` with a pre-pressed `lib` left no way to put
the Eureka module back in. After further consideration, I decided
it's wise to keep `lib`	that way instead of commingling it with
homelab data.
2023-11-27 00:13:06 -08:00
Antonio Gurgel
bc64f70610 Remove everything specific to my cluster 2023-11-26 23:41:14 -08:00
Antonio Gurgel
ffc18857a5 Export lib.rake 2023-11-26 22:38:11 -08:00
Antonio Gurgel
c4bb826b2a Rename project to turboprop
Getting away from manually pressing Helm charts (while, importantly, retaining
integrity checking and determinism) is something I liken to the
transition from sail to flight as the primary mode of intercontinental
travel. As it were, ditching the helm for a yoke.
2023-11-26 22:23:18 -08:00
Antonio Gurgel
b318f9fe5d Upgrade gateway-api to 1.0.0 2023-11-26 22:17:11 -08:00
Antonio Gurgel
021d366351 Forcibly set namespace on all Helm charts 2023-11-26 13:39:16 -08:00
Antonio Gurgel
fdd535c1fe Missed a spot in c641df6 2023-11-26 11:54:53 -08:00
Antonio Gurgel
dbc9ac3501 Typo 2023-11-26 11:28:10 -08:00
Antonio Gurgel
8dd5735b73 Fix mkExistingClaim
Turns out subPath isn't a top-level attribute, as it used to be.
2023-11-26 01:19:00 -08:00
Antonio Gurgel
ff01a6dcf7 Rant about namespace pitfalls
Several charts have tripped me up by lacking a namespace and therefore
dumping their resources into my default one.
2023-11-26 00:51:49 -08:00
Antonio Gurgel
9594cf686b Deal with colons in image _tags_
intel-gpu-exporter tripped me up because it's pinned to a SHA256.
(As well it should be. I should survey the rest for this possibility.)
2023-11-26 00:42:05 -08:00
Antonio Gurgel
1444cb9b18 s/release/service/g
"Helm releases" is what I'd been terming individual services, but
it makes no sense outside of the internal context of the Helm builder.

I also didn't want to call them "apps", however shorter that term is.
These are not apps.
2023-11-24 17:35:15 -08:00
Antonio Gurgel
f1332fc3ca Fix bug: include dirs in Kustomizations again
I meant to exclude `*.yaml.drv` but ended up excluding whole dirs too.
2023-11-24 17:35:00 -08:00
Antonio Gurgel
8607d8d1b1 Add Docker registries 2023-11-23 17:57:51 -08:00
Antonio Gurgel
a2f95cb53c Add cert-manager; use intermediate cert instead of CA 2023-11-23 17:04:15 -08:00
Antonio Gurgel
94615ae400 Add Argo Workflows 2023-11-23 15:37:18 -08:00
Antonio Gurgel
e9a0357fb9 Add common PV(C)s 2023-11-23 11:14:36 -08:00
Antonio Gurgel
c53071ef67 Tidy up 2023-11-23 10:34:53 -08:00
Antonio Gurgel
733868edee Document flake-builders.namespaces better 2023-11-23 10:08:38 -08:00
Antonio Gurgel
ef94817a55 Stop relying on ns/name in derivation path
I've changed release modules' signatures from:
`{lib} -> ... -> <drv>`
to:
`{lib} -> ... -> {out=<drv>; extra=<drv>;}`
Which makes individual derivations more easily findable.

Now, instead of picking them out from a soup of paths in `output.sh`
with a specially-crafted needle (`${ns}-${name}`), I map derivations
directly to paths and use the result as a sort of index. In other words,
I spent some ingenuity in `flake-builders.sh` to save a _lot_ of
ingenuity in `output.sh`.

This affords me the extra convenience, previously spurned because of
the very limitation I've overcome, of symlinking derivations in the
output flake.
2023-11-23 10:07:19 -08:00
Antonio Gurgel
ae070c60dc Add Istio base 2023-11-21 23:13:26 -08:00
Antonio Gurgel
be077878e7 Set default metadata for namespaces 2023-11-21 22:01:01 -08:00
Antonio Gurgel
6aff849da7 Add kyverno
I have my answer to 2638113, and it's what I was suspecting: the
flake-builder was never using clusterData until I added a release
that needs it, at which point I got the dreaded "error: attribute
'apiVersions' missing".

Remediation was simple: realize the wrongheadedness of passing
an empty attrset when the values are already well-known.
2023-11-21 20:58:13 -08:00
Antonio Gurgel
dc3060aa30 Pass charts into releases, and restore variadity
It doesn't pay to be strict about release module arity.
2023-11-21 20:46:32 -08:00
Antonio Gurgel
26381130e7 I don't understand this
Line 62 of this commit's flake.nix should bail with an attribute-missing
error while evaluating `buildDerivations.releases`, at the point where
Nix tries to inherit two variables from an empty `clusterData`.

...Or is it that I will have problems when I add something using
lib.builders.helmChart to `./system`? I'll only find out tomorrow.
2023-11-21 00:28:56 -08:00