{"id":13638479,"url":"https://github.com/loft-orbital/cuebe","last_synced_at":"2025-04-19T18:30:36.546Z","repository":{"id":38094044,"uuid":"421778811","full_name":"loft-orbital/cuebe","owner":"loft-orbital","description":"Deprecated, please check timoni","archived":true,"fork":false,"pushed_at":"2024-01-04T10:19:18.000Z","size":364,"stargazers_count":23,"open_issues_count":6,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-08T17:58:14.461Z","etag":null,"topics":["cue","devops","kubernetes"],"latest_commit_sha":null,"homepage":"https://timoni.sh","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loft-orbital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-27T10:48:25.000Z","updated_at":"2024-01-04T10:19:44.000Z","dependencies_parsed_at":"2024-01-04T11:31:18.544Z","dependency_job_id":"e51841c5-bc63-4441-afc0-b717f7e580fa","html_url":"https://github.com/loft-orbital/cuebe","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loft-orbital%2Fcuebe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loft-orbital%2Fcuebe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loft-orbital%2Fcuebe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loft-orbital%2Fcuebe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loft-orbital","download_url":"https://codeload.github.com/loft-orbital/cuebe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249764699,"owners_count":21322286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cue","devops","kubernetes"],"created_at":"2024-08-02T01:00:46.559Z","updated_at":"2025-04-19T18:30:36.182Z","avatar_url":"https://github.com/loft-orbital.png","language":"Go","readme":"# Cuebe\n\n\u003e This repository is now in read-only mode.\n\u003e If you're looking for a CUE based Kubernetes package manager, we recommend you to use [timoni](https://timoni.sh).\n\u003e We've moved our effort into timoni, helping its maintenance to avoid spreading efforts between very similar solutions.\n\u003e We believe timoni now covers everything cuebe was intended to be.\n\nKubernetes release manager powered by [CUE](https://cuelang.org/).\n\n## Why?\n\nWritting your Kubernetes manifests in CUE can drastically increase maintainability\nand reliability of your deployment workflow.\nThings that was previously reserved to source code\ncan now be used for the whole lifecycle of an application.\nThings like strong typing, reducing boilerplate, unit tests, etc...\n\nCuebe helps you deploying such resources.\nIt is the glue between the configuration and the k8s cluster.\nAkin what can kubectl do with YAML and JSON.\n\n## How?\n\nCuebe builds a [Context](#context) and collects every Kubernetes manifests in it.\nIt then uses [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)\nto deploy those resources.\n\n## Install\n\n### Release builds\n\nDownload the [latest release](https://github.com/loft-orbital/cuebe/releases/latest) from GitHub.\n\n### Install from Source\n\nYou will need [Go 1.17](https://go.dev/doc/install) or later installed.\n\n```shell\ngo install github.com/loft-orbital/cuebe/cmd/cuebe@latest\n```\n\nThis will install `cuebe` in your `$GOBIN` folder.\n\n## Concepts\n\n### Manifest\n\nA Manifest is a specification of a Kubernetes object in CUE format.\nA Manifest specifies the desired state of an object that Kubernetes will maintain when you apply it.\nA CUE value is considered as a Manifest if it has both string properties `apiVersion` and `kind`.\n\n```cue\nfoo: \"bar\"\nnamespace: {\n  apiVersion: \"v1\"\n  kind:       \"Namespace\"\n}\nnested: configmap: {\n  apiVersion: \"v1\"\n  kind:       \"ConfigMap\"\n}\n```\n\nHere both `namespace` and `nested.configmap` are considered as Manifest by Cuebe.\nWhereas foo just serves during build phase.\nEvery Manifest must eventually resolves to a JSON serializable object (concrete only values).\nOther values can be non-concrete, as Cuebe will not try to render them in a concrete format (YAML, JSON).\n\nSince Cuebe can collect any manifests in your Build, it's up to you to define boundaries.\nYou can use it to deploy single Manifest, a bunch of unrelated Manifests or use the [Instance](#instance) concept.\n\n### Instance\n\nAn instance is a group of [Manifests](#manifest) belonging to the same _application_.\nIt's a way to group multiple manifests under the same lifecycle.\nIf you're used to Helm, you can see a Cuebe Instance as a [Helm Release](https://helm.sh/docs/intro/using_helm/#three-big-concepts).\n\nA Manifest needs the `\"instance.cuebe.loftorbital.com/name\": \u003cinstance-name\u003e` label (in `metadata.labels`) to be a member of the _\u003cinstance-name\u003e_ Instance.\nIt's up to you to set this label on your Manifests.\n\nWhen deploying an Instance for the first time, Cuebe will create a Instance object.\nIt's a cluster-scoped custom resource which will keep track of Instance members.\nIt means an Instance must be unique to a cluster.\nYou cannot have multiple Instances with the same name in a single cluster.\n\nWhen deleting an Instance, even outside of Cuebe (e.g. with `kubectl`) it will automatically deletes subresources.\nThe way those resources are deleted can be managed with the `\"instance.cuebe.loftorbital.com/deletion-policy\"` annotation.\nWhen this annotation is set to `abandon`, the object will not be actually deleted, but its link to the instance removed (we call that an orphan Manifest).\nWhen this annotations is not set, the object will be normally deleted.\n\n### Build\n\nA Build is the action of building a [Context](#context) to [Manifests](#manifest), grouping them into [Instances](#instance) when required.\nWith `cuebe` cli you can _apply_ or _export_ a Build.\n\nYou can tweak the Build phase by using a special set of CUE attributes.\nCUE introduced the concept of [attibutes](https://cuelang.org/docs/references/spec/#attributes)\nto associate metadata information with value.\nCuebe leverage this mechanism to enhance your Build.\nIn addition to native attibutes, Cuebe introduces the following (exhaustive) list:\n\n#### @ignore\n\nThe `@ignore` attribute marks a value to be ignored by Cuebe.\nIt means Cuebe will not dive in this value.\nCuebe will hence ignore any Manifest under this value.\nThis can speed up the build process, avoiding unnecessary recursions.\n\n##### Syntax\n\n```cue\n@ignore()\n```\n\n##### Example\n\n```cue\nfoo: \"bar\"\nnamespace: {\n  apiVersion: \"v1\"\n  kind:       \"Namespace\"\n}\nnested: {\n  // This manifest will be ignored\n  configmap: {\n    apiVersion: \"v1\"\n    kind:       \"ConfigMap\"\n  }\n} @ignore()\n```\n\n### @inject\n\nAlthough CUE itslef offers a way to [inject value at runtime](https://cuetorials.com/patterns/inject/),\nit lacks some features.\nEspecially with secrets injection where it can become hard to maintain and scale, and does not fit well in a GitOps flow.\nFor that reason Cuebe introduces a way to inject values at runtime.\n\nThe `@inject` attribute allows surgical injection of external values in your Cuebe release.\nWe recommend using this attribute with parsimony, as `cue` itself will ignore it, making your Build hard to debug outside Cuebe.\nOne of our current use case is to inject sops encrypted values in the Build.\nIt allow us to keep a GitOps flow (no runtime config, everything commited) without leaking secrets.\n\nCuebe only supports local file injection as for now.\n\n##### Syntax\n\n```cue\n@inject(type=\u003ctype\u003e, src=\u003csrc\u003e [,path=\u003cpath\u003e])\n```\n\n- **type**: Injection type. Currerntly only supports `file`\n\n- **src**: Injection source.\nFor file injection, the path has to be relative to the Build [Context](#context).\nSupports cue, json or yaml plain or [sops-enccrypted](https://github.com/mozilla/sops) structured format,\nor any text file format when injecting unstructured (c.f. path).\n\n- **path**: [Optional] Path to extract the value from.\nFor file injection, when the path is not provided Cuebe treats the file as unstructured\nand does a plain text injection.\n\n##### Example\n\n_injection.yaml_\n\n```yaml\nnamespace:\n  name: potato\n```\n\n_plaintext.md_\n\n```md\n# Best sauces\n\nKetchup Mayo\n```\n\n_main.cue_\n\n```cue\nnamespace: {\n  apiVersion: \"v1\"\n  kind:       \"Namespace\"\n  metadata: {\n    name: string @inject(type=file, src=injection.yaml, path=$.namespace.name)\n  }\n}\n\nconfigmap: {\n\tapiVersion: \"v1\"\n\tkind:       \"ConfigMap\"\n\n\tmetadata: name: \"sauces\"\n\n\tdata: {\n\t\t\"README.md\": string @inject(src=plaintext.md, type=file)\n\t}\n}\n```\n\n### Context\n\nA Context is basically a filesystem that Cuebe uses to Build manifests and instances.\nCurrently Cuebe only supports local contexts (single file or directory).\nArchives (`tar.gz`) and remote Contexts (object storage, https endpoint, etc..) are in the pipe.\n\nWhen sending multiple Contexts to Cuebe, they will be merged before build.\nThink `rsync -a /ContextA/ /ContextB/`.\n\nWith Cuebe cli you can _pack_ a Context to upload it and reuse it during _apply_ or _export_ as soon as packs context (so-called cube) are supported.\n\n## Examples\n\nYou will find some examples in the [example folder](https://github.com/loft-orbital/cuebe/tree/main/example).\n\n## Roadmap\n\n- [x] Better injection system\n- [x] Release lifecycle management\n- [ ] Remote Contexts\n- [ ] Remote Injection\n- [ ] More examples\n","funding_links":[],"categories":["Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floft-orbital%2Fcuebe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floft-orbital%2Fcuebe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floft-orbital%2Fcuebe/lists"}