feat: COS-Dev mesh pt.2#349
Conversation
adhityaravi
left a comment
There was a problem hiding this comment.
One thing we might need to look into is, the beacon and ingress charms will error out without the istio-k8s charm. You mentioned in a different PR that the istio-k8s doesnt belong here.
If thats the case, shouldnt we atleast validate it? or is the idea that we let the charms error out and let the admin figure it out?
There was a problem hiding this comment.
I dont think we need to offer the require_cmr_mesh side of the CMR relation. We just need to offer the provide_cmr_mesh and the requirer will consume it with its own requirer side of the relation.
Good point, since there is no integration that istio-k8s offers, we have no way of validating this in COS' Terraform module, so we would need to resort to local-exec which we want to avoid if possible. |
|
A general API concern: mesh and reverse_proxy are not mutually exclusive concepts. Istio still uses an edge proxy You can theoretically still deploy just |
|
A rough idea to consider - reverse_proxy and mesh arent mutually exclusive but rather different depths at which COS as a product offers to model the network for the users level 0 - bring your own networking. We model 0 networking items This can be a single input var object called a This would also help us phase traefik completely out of COS without touching the API (however far in the future that might be or never but having an option is always nice) because we can still provide pure edge routing with istio-ingress without enabling the service mesh features of beacon. |
Co-authored-by: Michael Thamm <mike.thamm@canonical.com> Co-authored-by: Sina P <55766091+sinapah@users.noreply.github.com> Co-authored-by: Jose Massón <939888+Abuelodelanada@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Michael Thamm <mike.thamm@canonical.com> Co-authored-by: Sina P <55766091+sinapah@users.noreply.github.com>
#348) * docs(cos-lite): add details to prerequisites, link strict-install docs * added snap_microk8s to custom_wordlist.txt
Tip
We should remove Traefik if
ingressis all disabled. We should remove ssc ifinternal_tls = false. We should remove istio charms ifmesh_enabled = false.Issue
The existing COS-Dev Terraform API for configuring TLS and ingress (via Traefik) used a set of flat, disconnected variables (
internal_tls,external_ca_cert_offer_url,external_certificates_offer_url,mesh_enabled). As COS-Dev gains support for a service mesh as an alternative to Traefik-based ingress/TLS, this flat API made it increasingly awkward to express thatmeshandreverse_proxyare two mutually exclusive but parallel mechanisms for solving the same problem — securing and exposing COS services.Solution
Builds on:
This PR refactors the COS-Dev Terraform API to introduce two structured, parallel object variables —
reverse_proxyandmesh— replacing a collection of flat primitives. The new API makes the relationship between these two features explicit and consistent.API Changes
Before:
After:
Key motivations for the redesign:
Symmetry between
reverse_proxyandmesh: Both variables solve the same underlying problem (TLS termination and ingress for COS), but via different mechanisms. By giving them the same shape — anenabledflag and a nestedcmr_urlsobject — the API makes this relationship self-documenting.reverse_proxyis now explicitly opt-out: Previously, Traefik was always deployed and only conditionally integrated. Now it is gated behindreverse_proxy.enabled(defaulttrue), allowing users to fully disable it withenabled = false. This is the prerequisite for deploying COS with mesh only, or with neither.CMR URLs moved into the structured map:
external_ca_cert_offer_urlandexternal_certificates_offer_urlwere standalone top-level variables. They are now nested underreverse_proxy.cmr_urls.receive_ca_certandreverse_proxy.cmr_urls.certificates, co-locating all reverse proxy configuration in one place. The existing co-validation (both must be set together, or neither) is preserved.Mutual exclusivity is enforced: A Terraform validation rule prevents
mesh.enabledandreverse_proxy.enabledfrom both beingtruesimultaneously. Both can be disabled.Additional cleanups bundled in this PR
loki_bucket,mimir_bucket, andtempo_bucketare consolidated into a singles3_bucketsobject map.istio_beaconandistio_ingressmodule references are fixed (dashes → underscores) and their Juju charm data sources, channels, and revisions are properly wired up.var.mesh.enabled(they were unconditionally created before).mesh_enabled.tftest.hclis replaced bymesh.tftest.hclandreverse_proxy.tftest.hclto cleanly separate the two features.Testing Instructions
Run the Terraform tests:
The new test files cover:
reverse_proxy.tftest.hcl— Traefik deployed when enabled (default), not deployed when disabled.mesh.tftest.hcl— Istio deployed when mesh enabled, not deployed by default; validation error when bothmeshandreverse_proxyare enabled simultaneously.