-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sam Singh Anantha <[email protected]>
- Loading branch information
Showing
7 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!--monopod:start--> | ||
# cortex | ||
| | | | ||
| - | - | | ||
| **OCI Reference** | `cgr.dev/chainguard/cortex` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/cortex/overview/) | ||
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. | ||
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* | ||
|
||
--- | ||
<!--monopod:end--> | ||
|
||
<!--overview:start--> | ||
Cortex provides horizontally scalable, highly available, multi-tenant, long term storage for Prometheus. | ||
<!--overview:end--> | ||
|
||
<!--getting:start--> | ||
## Download this Image | ||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/cortex:latest | ||
``` | ||
<!--getting:end--> | ||
|
||
<!--body:start--> | ||
|
||
## Usage | ||
For full instructions on using cortex, refer to the | ||
[official documentation](https://cortexmetrics.io/docs/). | ||
The GitHub repository can also be [found here](https://github.com/cortexproject/cortex). | ||
|
||
### Helm | ||
To deploy cortex via helm, please refer to the | ||
[official helm charts documentation](https://cortexproject.github.io/cortex-helm-chart/) and the [helm charts repository](https://github.com/cortexproject/cortex-helm-chart) | ||
for comprehensive instructions, which includes | ||
[supported parameters](https://github.com/cortexproject/cortex-helm-chart/blob/master/values.yaml) | ||
|
||
Below is an example of how to use the helm chart, overriding the image with the | ||
chainguard image: | ||
|
||
```bash | ||
helm repo add cortex-helm https://cortexproject.github.io/cortex-helm-chart | ||
helm repo update | ||
|
||
helm install cortex --namespace cortex cortex-helm/cortex \ | ||
--set image.repository=cgr.dev/chainguard/cortex \ | ||
--set image.tag=latest | ||
``` | ||
<!--body:end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
variable "extra_packages" { | ||
description = "The additional packages to install" | ||
default = [ | ||
"cortex", | ||
] | ||
} | ||
|
||
data "apko_config" "this" { | ||
config_contents = file("${path.module}/template.apko.yaml") | ||
extra_packages = var.extra_packages | ||
} | ||
|
||
output "config" { | ||
value = jsonencode(data.apko_config.this.config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
contents: | ||
packages: [] | ||
|
||
accounts: | ||
groups: | ||
- groupname: nonroot | ||
gid: 65532 | ||
users: | ||
- username: nonroot | ||
uid: 65532 | ||
gid: 65532 | ||
run-as: 65532 | ||
|
||
entrypoint: | ||
command: cortex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "config" { source = "./config" } | ||
|
||
module "cortex" { | ||
source = "../../tflib/publisher" | ||
name = basename(path.module) | ||
target_repository = var.target_repository | ||
config = module.config.config | ||
build-dev = true | ||
|
||
} | ||
|
||
module "test" { | ||
source = "./tests" | ||
digest = module.cortex.image_ref | ||
} | ||
|
||
resource "oci_tag" "latest" { | ||
depends_on = [module.test] | ||
digest_ref = module.cortex.image_ref | ||
tag = "latest" | ||
} | ||
|
||
resource "oci_tag" "latest-dev" { | ||
depends_on = [module.test] | ||
digest_ref = module.cortex.dev_ref | ||
tag = "latest-dev" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: cortex | ||
image: cgr.dev/chainguard/cortex | ||
logo: https://storage.googleapis.com/chainguard-academy/logos/cortex.svg | ||
endoflife: "" | ||
console_summary: "" | ||
short_description: "Cortex provides horizontally scalable, highly available, multi-tenant, long term storage for Prometheus." | ||
compatibility_notes: "" | ||
readme_file: README.md | ||
upstream_url: https://cortexmetrics.io/ | ||
keywords: | ||
- analytics | ||
- application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
imagetest = { source = "chainguard-dev/imagetest" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
data "oci_string" "ref" { input = var.digest } | ||
|
||
data "imagetest_inventory" "this" {} | ||
|
||
resource "imagetest_harness_k3s" "this" { | ||
name = "cortex" | ||
inventory = data.imagetest_inventory.this | ||
sandbox = { | ||
mounts = [ | ||
{ | ||
source = path.module | ||
destination = "/tests" | ||
} | ||
] | ||
} | ||
} | ||
|
||
module "helm" { | ||
source = "../../../tflib/imagetest/helm" | ||
|
||
name = "cortex" | ||
namespace = "cortex" | ||
repo = "https://cortexproject.github.io/cortex-helm-chart" | ||
chart = "cortex" | ||
|
||
values = { | ||
image = { | ||
tag = data.oci_string.ref.pseudo_tag | ||
repository = data.oci_string.ref.registry_repo | ||
}, | ||
config = { | ||
blocks_storage = { | ||
backend = "filesystem" | ||
filesystem = { | ||
dir = "/data/tsdb" | ||
} | ||
} | ||
}, | ||
alertmanager = { | ||
enabled = false | ||
}, | ||
ruler = { | ||
enabled = false | ||
} | ||
} | ||
} | ||
|
||
resource "imagetest_feature" "basic" { | ||
name = "Basic" | ||
description = "Test a basic installation of Cortex Metrics" | ||
harness = imagetest_harness_k3s.this | ||
|
||
steps = [ | ||
{ | ||
name = "Helm install" | ||
cmd = module.helm.install_cmd | ||
} | ||
] | ||
|
||
labels = { | ||
type = "k8s", | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters