Skip to content

Commit 23ec6e9

Browse files
chore: correct gorelease config (#12)
* chore: correct gorelease config --------- Signed-off-by: Oliver Bähler <[email protected]>
1 parent f914c74 commit 23ec6e9

9 files changed

+99
-135
lines changed

.goreleaser.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ before:
88
gomod:
99
proxy: false
1010
builds:
11-
- main: .
11+
- main: cmd/
1212
binary: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
1313
env:
1414
- CGO_ENABLED=0
@@ -33,11 +33,15 @@ release:
3333
footer: |
3434
**Full Changelog**: https://github.com/projectcapsule/{{ .ProjectName }}/compare/{{ .PreviousTag }}...{{ .Tag }}
3535
36+
[!TIP]
37+
[Read this documentation](https://github.com/projectcapsule/{{ .ProjectName }}/blob/{{ .Tag }}/SECURITY.md) to see how you can verify an artifacts we are releasing.
38+
3639
**Docker Images**
3740
- `ghcr.io/projectcapsule/{{ .ProjectName }}:{{ .Version }}`
3841
- `ghcr.io/projectcapsule/{{ .ProjectName }}:latest`
3942
4043
**Helm Chart**
44+
4145
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/cortex-proxy)](https://artifacthub.io/packages/search?repo=cortex-proxy)
4246
4347
**Kubernetes compatibility**
@@ -52,8 +56,6 @@ release:
5256
5357
5458
Thanks to all the contributors! 🚀 🦄
55-
extra_files:
56-
- glob: ./capsule-seccomp.json
5759
checksum:
5860
name_template: 'checksums.txt'
5961
changelog:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
# Capsule ❤️ Cortex
2+
13
[!IMPORTANT]
24
This project is a permanent hard-fork of the [origin project](https://github.com/blind-oracle/cortex-tenant).
35

4-
# Capsule ❤️ Cortex
5-
66
![Capsule Cortex](docs/images/logo.png)
77

88
<p align="center">

SECURITY.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Release Artifacts
2+
3+
[See all the available artifacts](https://github.com/orgs/projectcapsule/packages?repo_name=cortex-proxy)
4+
5+
## Verifing
6+
7+
To verify artifacts you need to have [cosign installed](https://github.com/sigstore/cosign#installation). This guide assumes you are using v2.x of cosign. All of the signatures are created using [keyless signing](https://docs.sigstore.dev/verifying/verify/#keyless-verification-using-openid-connect).
8+
To verify the signature of the docker image, run the following command. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/cortex-proxy). The value `release_tag` is a release but without the prefix `v` (eg. `0.1.0-alpha.3`).
9+
10+
VERSION=<release_tag> cosign verify ghcr.io/projectcapsule/cortex-proxy:${VERSION} \
11+
--certificate-identity-regexp="https://github.com/projectcapsule/cortex-proxy/.github/workflows/docker-publish.yml@refs/tags/*" \
12+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" | jq
13+
14+
To verify the signature of the helm image, run the following command. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/charts%2Fcortex-proxy). The value `release_tag` is a release but without the prefix `v` (eg. `0.1.0-alpha.3`)
15+
16+
VERSION=<release_tag> cosign verify ghcr.io/projectcapsule/charts/cortex-proxy:${VERSION} \
17+
--certificate-identity-regexp="https://github.com/projectcapsule/cortex-proxy/.github/workflows/helm-publish.yml@refs/tags/*" \
18+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" | jq
19+
20+
## Verifying Provenance
21+
22+
We create and attest the provenance of our builds using the [SLSA standard](https://slsa.dev/spec/v0.2/provenance) and meets the [SLSA Level 3](https://slsa.dev/spec/v0.1/levels) specification. The attested provenance may be verified using the cosign tool.
23+
24+
Verify the provenance of the docker image. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/cortex-proxy). The value `release_tag` is a release but without the prefix `v` (eg. `0.1.0-alpha.3`)
25+
26+
```bash
27+
cosign verify-attestation --type slsaprovenance \
28+
--certificate-identity-regexp="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/*" \
29+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
30+
ghcr.io/projectcapsule/cortex-proxy:<release_tag> | jq .payload -r | base64 --decode | jq
31+
```
32+
33+
Verify the provenance of the helm image. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/charts%cortex-proxy). The value `release_tag` is a release but without the prefix `v` (eg. `0.1.0-alpha.3`)
34+
35+
```bash
36+
VERSION=<release_tag> cosign verify-attestation --type slsaprovenance \
37+
--certificate-identity-regexp="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/*" \
38+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
39+
"ghcr.io/projectcapsule/charts/cortex-proxy:${VERSION}" | jq .payload -r | base64 --decode | jq
40+
```
41+
42+
## Software Bill of Materials (SBOM)
43+
44+
An SBOM (Software Bill of Materials) in CycloneDX JSON format is published for each release, including pre-releases.
45+
46+
To inspect the SBOM of the docker image, run the following command. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/cortex-proxy):
47+
48+
COSIGN_REPOSITORY=ghcr.io/projectcapsule/cortex-proxy cosign download sbom ghcr.io/projectcapsule/cortex-proxy:<release_tag>
49+
50+
To inspect the SBOM of the helm image, run the following command. Replace `<release_tag>` with an [available release tag](https://github.com/projectcapsule/cortex-proxy/pkgs/container/charts%2Fcortex-proxy):
51+
52+
COSIGN_REPOSITORY=ghcr.io/projectcapsule/charts/cortex-proxy cosign download sbom ghcr.io/projectcapsule/charts/cortex-proxy:<release_tag>

charts/cortex-proxy/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following Values are available for this chart.
4040
| fullnameOverride | string | `""` | |
4141
| image.pullPolicy | string | `"IfNotPresent"` | Set the image pull policy. |
4242
| image.registry | string | `"ghcr.io"` | Set the image registry |
43-
| image.repository | string | `"projectcapsule/cortex-tenant"` | Set the image repository |
43+
| image.repository | string | `"projectcapsule/cortex-proxy"` | Set the image repository |
4444
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
4545
| imagePullSecrets | list | `[]` | Configuration for `imagePullSecrets` so that you can use a private images registry. |
4646
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":10080}}` | Configure the liveness probe using Deployment probe spec |
@@ -107,7 +107,7 @@ The following Values are available for this chart.
107107
| monitoring.enabled | bool | `false` | Enable Monitoring of the Operator |
108108
| monitoring.rules.annotations | object | `{}` | Assign additional Annotations |
109109
| monitoring.rules.enabled | bool | `true` | Enable deployment of PrometheusRules |
110-
| monitoring.rules.groups | list | `[{"name":"TranslatorAlerts","rules":[{"alert":"TranslatorNotReady","annotations":{"description":"The Translator {{ $labels.name }} has been in a NotReady state for over 5 minutes.","summary":"Translator {{ $labels.name }} is not ready"},"expr":"cca_translator_condition{status=\"NotReady\"} == 1","for":"5m","labels":{"severity":"warning"}}]}]` | Prometheus Groups for the rule |
110+
| monitoring.rules.groups | list | `[]` | Prometheus Groups for the rule |
111111
| monitoring.rules.labels | object | `{}` | Assign additional labels |
112112
| monitoring.rules.namespace | string | `""` | Install the rules into a different Namespace, as the monitoring stack one (default: the release one) |
113113
| monitoring.serviceMonitor.annotations | object | `{}` | Assign additional Annotations |

charts/cortex-proxy/values.schema.json

-44
Original file line numberDiff line numberDiff line change
@@ -183,50 +183,6 @@
183183
"type": "boolean"
184184
},
185185
"groups": {
186-
"items": {
187-
"properties": {
188-
"name": {
189-
"type": "string"
190-
},
191-
"rules": {
192-
"items": {
193-
"properties": {
194-
"alert": {
195-
"type": "string"
196-
},
197-
"annotations": {
198-
"properties": {
199-
"description": {
200-
"type": "string"
201-
},
202-
"summary": {
203-
"type": "string"
204-
}
205-
},
206-
"type": "object"
207-
},
208-
"expr": {
209-
"type": "string"
210-
},
211-
"for": {
212-
"type": "string"
213-
},
214-
"labels": {
215-
"properties": {
216-
"severity": {
217-
"type": "string"
218-
}
219-
},
220-
"type": "object"
221-
}
222-
},
223-
"type": "object"
224-
},
225-
"type": "array"
226-
}
227-
},
228-
"type": "object"
229-
},
230186
"type": "array"
231187
},
232188
"labels": {

charts/cortex-proxy/values.yaml

+18-13
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ image:
8787
# -- Set the image registry
8888
registry: ghcr.io
8989
# -- Set the image repository
90-
repository: projectcapsule/cortex-tenant
90+
repository: projectcapsule/cortex-proxy
9191
# -- Set the image pull policy.
9292
pullPolicy: IfNotPresent
9393
# -- Overrides the image tag whose default is the chart appVersion.
@@ -219,18 +219,23 @@ monitoring:
219219
# -- Assign additional Annotations
220220
annotations: {}
221221
# -- Prometheus Groups for the rule
222-
groups:
223-
- name: TranslatorAlerts
224-
rules:
225-
- alert: TranslatorNotReady
226-
expr: cca_translator_condition{status="NotReady"} == 1
227-
for: 5m
228-
labels:
229-
severity: warning
230-
annotations:
231-
summary: "Translator {{ $labels.name }} is not ready"
232-
description: "The Translator {{ $labels.name }} has been in a NotReady state for over 5 minutes."
233-
222+
groups: []
223+
# - alert: CortexProxyTooMany500s
224+
# expr: 100 * ( sum( timeseries_request_duration_seconds{code=~"5.+"} ) / sum(timeseries_request_duration_seconds) ) > 5
225+
# for: 5m
226+
# labels:
227+
# severity: warning
228+
# annotations:
229+
# description: Too many 5XXs
230+
# summary: More than 5% of all requests returned 5XX, this requires your attention
231+
# - alert: CortexProxyTooMany400s
232+
# expr: 100 * ( sum( timeseries_request_duration_seconds{status=~"4.+"} ) / sum(timeseries_request_duration_seconds) ) > 5
233+
# for: 5m
234+
# labels:
235+
# severity: warning
236+
# annotations:
237+
# description: Too many 4XXs
238+
# summary: More than 5% of all requests returned 4XX, this requires your attention
234239
# ServiceMonitor
235240
serviceMonitor:
236241
# -- Enable ServiceMonitor

docs/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
See the following topics for more information on how to use this addon:
44

5-
- [Installation](installation.md)
65
- [Configuration](configuration.md)
76
- [Monitoring](monitoring.md)
87
- [Development](development.md)

docs/configuration.md

+20-51
Original file line numberDiff line numberDiff line change
@@ -6,107 +6,77 @@ If both are used then the env vars have precedence (i.e. they override values fr
66
See below for config file format and corresponding env vars.
77

88
```yaml
9-
# Where to listen for incoming write requests from Prometheus
10-
# env: CT_LISTEN
11-
listen: 0.0.0.0:8080
12-
13-
# Profiling API, remove to disable
14-
# env: CT_LISTEN_PPROF
15-
listen_pprof: 0.0.0.0:7008
16-
179
# Where to send the modified requests (Cortex/Mimir)
1810
backend:
1911
url: http://127.0.0.1:9091/receive
2012
# Authentication (optional)
2113
auth:
22-
# Egress HTTP basic auth -> add `Authentication` header to outgoing requests
23-
egress:
24-
# env: CT_AUTH_EGRESS_USERNAME
25-
username: foo
26-
# env: CT_AUTH_EGRESS_PASSWORD
27-
password: bar
14+
username: foo
15+
password: bar
2816

2917
# Whether to enable querying for IPv6 records
30-
# env: CT_ENABLE_IPV6
31-
enable_ipv6: false
18+
ipv6: false
3219

3320
# This parameter sets the limit for the count of outgoing concurrent connections to Cortex / Mimir.
3421
# By default it's 64 and if all of these connections are busy you will get errors when pushing from Prometheus.
3522
# If your `target` is a DNS name that resolves to several IPs then this will be a per-IP limit.
36-
# env: CT_MAX_CONNS_PER_HOST
37-
max_conns_per_host: 0
23+
maxConnectionsPerHost: 0
3824

3925
# HTTP request timeout
40-
# env: CT_TIMEOUT
4126
timeout: 10s
4227

4328
# Timeout to wait on shutdown to allow load balancers detect that we're going away.
4429
# During this period after the shutdown command the /alive endpoint will reply with HTTP 503.
4530
# Set to 0s to disable.
46-
# env: CT_TIMEOUT_SHUTDOWN
47-
timeout_shutdown: 10s
31+
timeoutShutdown: 10s
4832

4933
# Max number of parallel incoming HTTP requests to handle
50-
# env: CT_CONCURRENCY
5134
concurrency: 10
5235

5336
# Whether to forward metrics metadata from Prometheus to Cortex/Mimir
5437
# Since metadata requests have no timeseries in them - we cannot divide them into tenants
5538
# So the metadata requests will be sent to the default tenant only, if one is not defined - they will be dropped
56-
# env: CT_METADATA
5739
metadata: false
5840

59-
# If true response codes from metrics backend will be logged to stdout. This setting can be used to suppress errors
60-
# which can be quite verbose like 400 code - out-of-order samples or 429 on hitting ingestion limits
61-
# Also, those are already reported by other services like Cortex/Mimir distributors and ingesters
62-
# env: CT_LOG_RESPONSE_ERRORS
63-
log_response_errors: true
64-
6541
# Maximum duration to keep outgoing connections alive (to Cortex/Mimir)
6642
# Useful for resetting L4 load-balancer state
6743
# Use 0 to keep them indefinitely
68-
# env: CT_MAX_CONN_DURATION
69-
max_connection_duration: 0s
70-
71-
# Address where metrics are available
72-
# env: CT_LISTEN_METRICS_ADDRESS
73-
listen_metrics_address: 0.0.0.0:9090
44+
maxConnectionDuration: 0s
7445

75-
# If true, then a label with the tenant’s name will be added to the metrics
76-
# env: CT_METRICS_INCLUDE_TENANT
77-
metrics_include_tenant: true
46+
# Select only a subset of tenant to consider for collection
47+
# namespaces which can not be assigned to any tenant will get the
48+
# default value
49+
selector:
50+
matchLabels:
51+
env: "prod"
7852

7953
tenant:
8054
# List of labels examined for tenant information.
81-
# env: CT_TENANT_LABEL_LIST
82-
label_list:
83-
- tenant
84-
- other_tenant
55+
labels:
56+
- namespace
57+
- target_namespace
8558

8659
# Whether to remove the tenant label from the request
87-
# env: CT_TENANT_LABEL_REMOVE
88-
label_remove: true
60+
labelRemove: true
8961

9062
# To which header to add the tenant ID
91-
# env: CT_TENANT_HEADER
9263
header: X-Scope-OrgID
9364

9465
# Which tenant ID to use if the label is missing in any of the timeseries
9566
# If this is not set or empty then the write request with missing tenant label
9667
# will be rejected with HTTP code 400
97-
# env: CT_TENANT_DEFAULT
68+
# Namespaces which can not be assigned to any tenant will get the
69+
# default value
9870
default: foobar
9971

10072
# Enable if you want all metrics from Prometheus to be accepted with a 204 HTTP code
10173
# regardless of the response from upstream. This can lose metrics if Cortex/Mimir is
10274
# throwing rejections.
103-
# env: CT_TENANT_ACCEPT_ALL
104-
accept_all: false
75+
acceptAll: false
10576

10677
# Optional prefix to be added to a tenant header before sending it to Cortex/Mimir.
10778
# Make sure to use only allowed characters:
10879
# https://grafana.com/docs/mimir/latest/configure/about-tenant-ids/
109-
# env: CT_TENANT_PREFIX
11080
prefix: foobar-
11181

11282
# If true will use the tenant ID of the inbound request as the prefix of the new tenant id.
@@ -115,6 +85,5 @@ tenant:
11585
# Prometheus forwards metrics with `X-Scope-OrgID: Prom-A` set in the inbound request.
11686
# This would result in the tenant prefix being set to `Prom-A-`.
11787
# https://grafana.com/docs/mimir/latest/configure/about-tenant-ids/
118-
# env: CT_TENANT_PREFIX_PREFER_SOURCE
119-
prefix_prefer_source: false
88+
prefixPreferSource: false
12089
```

docs/overview.md

-19
This file was deleted.

0 commit comments

Comments
 (0)