Skip to content

Commit

Permalink
add release drafter workflow and add badge to readme, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-medvedev-codefresh committed Jul 2, 2024
1 parent 0e7a78a commit e298861
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .e2e/chainsaw-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@ spec:
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: sm-without-ns-selector
spec:
steps:
- try:
- assert:
resource:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: sm-without-ns-selector-x-default-x-vcluster
namespace: default
spec:
namespaceSelector: {}
selector:
# Resources are deployed to default namespace of vcluster
matchExpressions:
- key: vcluster.loft.sh/namespace
operator: In
values:
- default
matchLabels:
vcluster.loft.sh/label-vcluster-x-a172cedcae: example-app
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: pm-with-ns-selector
spec:
Expand Down
15 changes: 15 additions & 0 deletions .e2e/vcluster-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ spec:
- port: web
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: sm-without-ns-selector
namespace: default
labels:
team: frontend
spec:
namespaceSelector: {}
selector:
matchLabels:
app: example-app
endpoints:
- port: web
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: pm-with-ns-selector
Expand Down
38 changes: 38 additions & 0 deletions .github/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
label: "chore"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
exclude-labels:
- "no-release"
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
- "feature"
- "enhancement"
patch:
labels:
- "patch"
- "fix"
- "bugfix"
- "bug"
- "dependencies"
default: patch
template: |
## Changes
$CHANGES
19 changes: 19 additions & 0 deletions .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Draft Release

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: false
config-name: release-drafter.yaml
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vCluster Prometheus operator plugin

[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/codefresh-inc/codefresh-contrib%2Fvcluster-prometheus-operator-plugin%2Fci?type=cf-1)]( https://g.codefresh.io/public/accounts/codefresh-inc/pipelines/new/667d09d7db9387f8b1294868)

This repository contains a [vCluster plugin](https://www.vcluster.com/docs/v0.19/advanced-topics/plugins-overview) that syncs [Prometheus operator](https://github.com/prometheus-operator/prometheus-operator) resources from virtual clusters to the host cluster.

Currently only the very basic functionality is implemented so the plugin only supports syncing of `PodMonitor` and `ServiceMonitor` resources. This is to allow scraping of metrics from workloads running on virtual clusters from a signle Prometheus or Open Telemetry collector on the host (with [target allocator](https://github.com/open-telemetry/opentelemetry-operator/blob/main/cmd/otel-allocator/README.md) that supports Prometheus operator CRDs).
Expand All @@ -9,4 +11,4 @@ This compatibility is required as Syncer arhitecture was overhauled by loft.sh i

`v1` - Compatible with older versions of vCluster - latest confirmed & tested version is `0.16.4`

`v2` - Compatibe with vCluster version 0.20.0 which was the highest version at the time of writing.
`v2` - Compatibe with vCluster version `0.20.0-beta.9` which was the latest version at the time of writing.

0 comments on commit e298861

Please sign in to comment.