timoni icon indicating copy to clipboard operation
timoni copied to clipboard

Write a guide for developing modules

Open stefanprodan opened this issue 3 years ago • 3 comments

The guide can be based on examples/podinfo and should include:

  • an introduction to CUE lang
  • an introduction to CUE modules
  • explain what are the conventions to make a CUE module compatible with Timoni
  • how to create a Timoni module from scratch with timoni mod init
  • how to import Kubernetes types and generate CUE definitions
  • how to create templates using the generated Kubernetes CUE definitions
  • explain the role of templates/config.cue and how it relates to values.cue
  • explain the role of timoni.cue and how it relates to timoni build
  • explain how the user-defined values.cue files are merged and why Timoni had to break CUE immutability

stefanprodan avatar Feb 21 '23 10:02 stefanprodan

how to create a Timoni module from scratch with timoni mod init

I find that the full-blown podinfo piece this command currently generates is a bit too complex for getting started, ideally, I think it should write out a bare minimum, perhaps just a skeleton. Of course, you need to strike a balance here, but perhaps we could try to use a deployment with a few basic parameters, e.g. namespace, labels, image & replicas?

errordeveloper avatar Apr 18 '23 09:04 errordeveloper

Hey @stefanprodan this looks great, how have I only just discovered this project! It aligns really closely with some discussions I've been having about Helm improvements such as using CUE to create the values YAML & schema, Cosign signing, and separating chart developer and chart consumer responsibilities.

I have a couple of questions, apologies if I've missed them as a latecomer.

  • Is there an example of a module for a complex system (multi component) such as Thanos?
  • Are there plans to add module developer tooling for image dependencies?
    • Standard image updates (e.g. v1.0.01 -> v1.0.1)
    • Rolling images such as Chainguard where the digest should be updated if it's changed
  • Have you considered supporting generating Helm charts from Timoni?

stevehipwell avatar Jan 05 '24 16:01 stevehipwell

I used the documentation to do this and found it pretty complete so I would say this can be closed.

Only thing was this:

explain how the user-defined values.cue files are merged and why Timoni had to break CUE immutability

It might be in there in some way, but it didn't come across to me when going through things.

salotz avatar Mar 20 '24 15:03 salotz