https://github.com/schubergphilis/cue-kube-tenant
Timoni/CUE backed module for Tenant K8s object generation.
https://github.com/schubergphilis/cue-kube-tenant
cue kubernetes
Last synced: 12 months ago
JSON representation
Timoni/CUE backed module for Tenant K8s object generation.
- Host: GitHub
- URL: https://github.com/schubergphilis/cue-kube-tenant
- Owner: schubergphilis
- License: apache-2.0
- Created: 2023-08-09T10:12:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T16:21:10.000Z (almost 3 years ago)
- Last Synced: 2025-06-13T22:41:23.154Z (about 1 year ago)
- Topics: cue, kubernetes
- Language: CUE
- Homepage:
- Size: 243 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tenant
Module used to quickly generate K8s Tenants using [CUE](https://cuelang.org/) and [Timoni](https://timoni.sh/).
## Values
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | `string` | n/a | yes |
| annotations | Annotations to be added to the K8s objects | `{[string]: string}` | `{}` | yes |
| role | Currently only admin and namespace-admin are supported | `string` | `namespace-admin` | no |
| gitopsAgent | Create objects for gitops agent, currently only fluxV2(GitSource + Kustomization) is supported. | `string` | `""` | no
Supported: [flux](https://fluxcd.io/) |
| git | Needs to be configured with gitopsAgent | `{[string]: string}`|
git: {
url: ""
branch: ""
path: ""
interval: "5m"
timeout: "1m"
prune: true
} | Only with gitopsAgent
For flux see [here](https://fluxcd.io/flux/components/kustomize/kustomization/) and [here](https://fluxcd.io/flux/components/source/gitrepositories/#working-with-gitrepositories) |
| slack | Needs to be configured with gitopsAgent |`{[string]: string}` | slack: {
enabled: false
channel: ""
secretName: ""
summary: ""
} | Only with gitopsAgent
For Flux [see](https://fluxcd.io/flux/guides/notifications/) |
| metadata: labels | Overwrite labels | `"app.kubernetes.io/tenant": metadata.name` | `{} ` | no |
## Example usage
```cue
// tenants.cue
_module: {
url: "oci://ghcr.io/schubergphilis/cue-modules/tenant"
version: "0.0.1"
}
_common_values: {// set common_values
gitopsAgent: "flux"
git: {
url: "ssh://git@testgit.com/test-repo.git"
branch: "main"
interval: "5m"
}
}
bundle: {
apiVersion: "v1alpha1"
name: "tenants"
instances: {// each instances can present a tenant
frontend: {
module: _module
namespace: "frontend"
values: _common_values
values: role: "admin"
values: name: "frontend-team"
values: git: path: "./frontend"
}
backend: {
module: _module
namespace: "backend"
values: _common_values // reuse common values
values: {
name: "backend-team"
role: "cluster-admin"
git: path: "./backend"
}
}
}
}
```