Skip to content

Commit

Permalink
chore: implement Helm chart repository
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk committed Feb 29, 2024
0 parents commit fbe8eba
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
helm_version: [3.11.1]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: '${{ matrix.helm_version }}'

- name: Helm version
run: helm version -c

- name: Run lint
run: helm lint .
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release Charts

on:
push:
branches:
- main

permissions: {}

jobs:
release:
permissions:
packages: write # needed for ghcr access
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install deps
run: npm i -q --no-save @semantic-release/exec @semantic-release/git

- name: Release a new version
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Helm
uses: azure/setup-helm@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Login to GHCR
run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: Push charts to GHCR
run: helm push sniffer-chart oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts/*
.idea
.vscode
6 changes: 6 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github/*
docs/*
.git/*
.gitignore
CONTRIBUTING.md
test/*
51 changes: 51 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "case $OSTYPE in darwin*) SEDOPTION=\" \";; esac && sed -i$SEDOPTION'' -e 's/version:.*/version: ${nextRelease.version}/g' Chart.yaml"
}
],
[
"@semantic-release/git",
{
"assets": ["**/Chart.yaml"],
"message": "chore(release): cut the ${nextRelease.version} release [skip ci]"
}
],
[
"@semantic-release/github",
{
"labels": false,
"releasedLabels": false,
"failTitle": false,
"failComment": false,
"successComment": false
}
]
],
"branches": [
"main"
],
"ci": true
}
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) 2024 Bright Security

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.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Helm Chart for Bright Sniffer

[Helm](https://helm.sh/) must be installed to use the charts. Please refer to Helm's [documentation](https://helm.sh/docs/) to get started.

## Clone the repository:

```shell
git clone [email protected]:NeuraLegion/sniffer-helm.git --depth 1
cd ./sniffer-helm
```

## Render the Helm templates:

```shell
helm template .
```

## Install the agent:

Use the Helm command to install the Sniffer agent:

```shell
helm install sniffer-agent . -f values.yaml
```

## Override default configurations (using values.yaml):

To customize configurations, modify the `values.yaml` file as follows:

```yaml
api:
apiKey: '<your API key with entry-points:manage or entry-points:admin scopes>'
apiURL: 'https://app.brightsec.com/'
projectID: '<your Bright project ID>'

sniffer:
image:
pullPolicy: Always

extraArgs:
group-public-ips: true
send-traffic-delta: true
ebpf-dns-tracer-enabled: false
```
## Uninstall the agent:
To remove the Sniffer agent, use the following command:
```shell
helm uninstall sniffer-agent
```

## License

Copyright © 2024 [Bright Security](https://brightsec.com/).

This project is licensed under the MIT License - see the [LICENSE file](LICENSE) for details.

0 comments on commit fbe8eba

Please sign in to comment.