Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPokorny authored and Jan Pokorný committed Sep 21, 2023
0 parents commit 10d42bb
Show file tree
Hide file tree
Showing 10 changed files with 620 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/reindex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Reindex

on:
release:
types: [released]
workflow_run:
workflows: ["Release"]
types: [completed]
workflow_dispatch:

permissions:
id-token: write
pages: write
contents: read

jobs:
reindex:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo snap install yq
- name: Generate Helm repository index.yaml
run: |
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.repository }}/releases" | \
yq -P '{ "apiVersion": "v1", "entries": { "betterstack-logs": . | map({ "name": "betterstack-logs", "urls": [ .assets[0].browser_download_url ], "version": .tag_name }) } }' >index.yaml
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Ensure that chart version in YAML is the same as release tag
run: |
sed -i "s/^version: .*/version: ${GITHUB_REF#refs\/tags\/v}/" Chart.yaml
git diff --exit-code
- name: Install Helm
uses: azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update chart dependencies
run: helm dependency update
- name: Package chart
run: helm package .
- name: Create a release
uses: softprops/action-gh-release@v1
with:
files: '*.tgz'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tgz
2 changes: 2 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.github
9 changes: 9 additions & 0 deletions Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: metrics-server
repository: https://kubernetes-sigs.github.io/metrics-server/
version: 3.11.0
- name: vector
repository: https://helm.vector.dev
version: 0.24.1
digest: sha256:9177ce1768849d300b573f753830f0636daafa5e582679b85340300415bbfe45
generated: "2023-09-21T14:01:43.613145334+02:00"
10 changes: 10 additions & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: betterstack-logs
version: 1.0.0
dependencies:
- name: metrics-server
version: '>=0'
repository: https://kubernetes-sigs.github.io/metrics-server/
- name: vector
version: '>=0'
repository: https://helm.vector.dev
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Better Stack, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [Better Stack](https://betterstack.com/logs) Helm chart

A Helm chart for sending Kubernetes logs and metrics to Better Stack.

[![Better Stack dashboard](https://github.com/logtail/logtail-js/assets/10132717/96b422e7-3026-49c1-bd45-a946c37211d0)](https://betterstack.com/logs)

[![MIT License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

Experience SQL-compatible structured log management based on ClickHouse. [Learn more ⇗](https://betterstack.com/logs)

## Documentation

[Getting started ⇗](https://betterstack.com/docs/logs/kubernetes/#helm)

## Need help?
Please let us know at [[email protected]](mailto:[email protected]). We're happy to help!

---

[MIT license](LICENSE)
41 changes: 41 additions & 0 deletions templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: vector-metrics
labels:
app.kubernetes.io/name: vector
app.kubernetes.io/instance: vector
app.kubernetes.io/component: Agent
rules:
- apiGroups:
- "metrics.k8s.io"
resources:
- nodes
- pods
verbs:
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: vector-metrics
labels:
app.kubernetes.io/name: vector
app.kubernetes.io/instance: vector
app.kubernetes.io/component: Agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vector-metrics
subjects:
- kind: ServiceAccount
name: '{{ .Release.Name }}-vector'
namespace: '{{ .Release.Namespace }}'
---
apiVersion: v1
kind: Secret
metadata:
name: vector-service-account
annotations:
kubernetes.io/service-account.name: '{{ .Release.Name }}-vector'
type: kubernetes.io/service-account-token
Loading

0 comments on commit 10d42bb

Please sign in to comment.