This repository has been archived by the owner on Oct 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from p1nkun1c0rns/finalise2v1
from 0.0.1 to 1.0.0
- Loading branch information
Showing
16 changed files
with
328 additions
and
6 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,9 @@ | ||
version: 1 | ||
update_configs: | ||
- package_manager: "docker" | ||
directory: "/" | ||
update_schedule: "weekly" | ||
automerged_updates: | ||
- match: | ||
dependency_type: "all" | ||
update_type: "all" |
Validating CODEOWNERS rules β¦
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 @@ | ||
* @steinbrueckri |
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,42 @@ | ||
name: "Test" | ||
on: | ||
pull_request: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/*' | ||
schedule: | ||
- cron: '22 22 * * 5' | ||
|
||
jobs: | ||
lint: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Markdown Lint | ||
uses: actionshub/[email protected] | ||
|
||
- name: YAML Lint | ||
uses: karancode/yamllint-github-action@master | ||
with: | ||
yamllint_file_or_dir: action.yml | ||
|
||
- name: Dockerfile Lint | ||
uses: burdzwastaken/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HADOLINT_ACTION_DOCKERFILE_FOLDER: . | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run CI script | ||
run: ./test/ci-test.sh | ||
|
||
- name: Run action | ||
uses: ./ | ||
with: | ||
path: "./test/test_data/good_case_1" | ||
file_extension: "*.yaml" | ||
exclude: "skip" |
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 @@ | ||
rules "~MD013,~MD024,~MD033" |
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,22 @@ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 Richard SteinbrΓΌck and contributors | ||
|
||
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. |
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 |
---|---|---|
@@ -1 +1,45 @@ | ||
# prometheus-operator-lint-action | ||
# prometheus-operator-lint-action | ||
|
||
[![Test](https://github.com/p1nkun1c0rns/prometheus-operator-lint-action/workflows/Test/badge.svg)](https://github.com/p1nkun1c0rns/prometheus-operator-lint-action/actions?query=workflow%3ATest) | ||
|
||
This action ... | ||
|
||
## Contributions | ||
|
||
- Contributions are welcome! | ||
- Give :star: - if you want to encourage me to work on a project | ||
- Don't hesitate create issue for new feature you dream of or if you suspect some bug | ||
|
||
## Project versioning | ||
|
||
Project use [Semantic Versioning](https://semver.org/). | ||
We recommended to use the latest and specific release version. | ||
|
||
In order to keep your project dependencies up to date you can watch this repository *(Releases only)* | ||
or use automatic tools like [Dependabot](https://dependabot.com/). | ||
|
||
## Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
### Simple | ||
|
||
```yml | ||
steps: | ||
- uses: p1nkun1c0rns/prometheus-operator-lint-action@master | ||
``` | ||
### Advanced | ||
```yml | ||
steps: | ||
- uses: p1nkun1c0rns/prometheus-operator-lint-action@master | ||
with: | ||
path: "./" | ||
file_extension: "*.yaml" | ||
exclude: "foobar" | ||
``` | ||
## License | ||
The scripts and documentation in this project are released under the [MIT License](LICENSE) |
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
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
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,69 @@ | ||
#!/bin/bash | ||
|
||
docker build -t prometheus-operator-lint-action . | ||
|
||
error_count=0 | ||
|
||
# good case 1 ################################################################# | ||
############################################################################### | ||
TESTCASE="good_case_1" | ||
INPUT_PATH="/mnt/$TESTCASE" | ||
INPUT_FILES="*.yaml" | ||
INPUT_EXCLUDE="skip" | ||
|
||
docker run --rm \ | ||
-v $(pwd)/test/test_data:/mnt/ \ | ||
prometheus-operator-lint-action $INPUT_PATH $INPUT_FILES $INPUT_EXCLUDE | ||
|
||
RESULT=$? | ||
if [ $RESULT == 0 ]; then | ||
echo "β $TESTCASE test passed" | ||
else | ||
echo "β $TESTCASE test failed" | ||
error_count=$((error_count+1)) | ||
fi | ||
|
||
unset TESTCASE | ||
|
||
# good case 2 ################################################################# | ||
############################################################################### | ||
TESTCASE="good_case_2" | ||
INPUT_PATH="/mnt/$TESTCASE" | ||
INPUT_FILES="*.yaml" | ||
INPUT_EXCLUDE="" | ||
|
||
docker run --rm \ | ||
-v $(pwd)/test/test_data:/mnt/ \ | ||
prometheus-operator-lint-action $INPUT_PATH $INPUT_FILES $INPUT_EXCLUDE | ||
|
||
RESULT=$? | ||
if [ $RESULT == 0 ]; then | ||
echo "β $TESTCASE test passed" | ||
else | ||
echo "β $TESTCASE test failed" | ||
error_count=$((error_count+1)) | ||
fi | ||
|
||
# test the bad case ########################################################### | ||
############################################################################### | ||
TESTCASE="bad_case_1" | ||
INPUT_PATH="/mnt/$TESTCASE" | ||
INPUT_FILES="*.yaml" | ||
INPUT_EXCLUDE="skip" | ||
|
||
docker run --rm \ | ||
-v $(pwd)/test/test_data:/mnt/ \ | ||
prometheus-operator-lint-action $INPUT_PATH $INPUT_FILES $INPUT_EXCLUDE | ||
|
||
RESULT=$? | ||
if [ $RESULT == 0 ]; then | ||
echo "β $TESTCASE test failed" | ||
error_count=$((error_count+1)) | ||
else | ||
echo "β $TESTCASE test passed" | ||
fi | ||
|
||
############################################################################### | ||
# exit | ||
############################################################################### | ||
exit $error_count |
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 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: prometheus-operator | ||
release: prometheus-operator | ||
name: redis | ||
namespace: monitoring | ||
spec: | ||
groups: | ||
- name: redis.memory | ||
rules: | ||
- alerts: RedisMemoryAlmostFull | ||
annotations: | ||
messages: 'Redis memory is at {{ $value | humanizePercentage }} of maximum for 2 days in a row' | ||
expr: redis_memory_used_bytes/redis_memory_max_bytes > 0.8 | ||
f0r: 2d | ||
labels: | ||
severity: warning |
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,16 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: karma | ||
namespace: monitoring | ||
spec: | ||
jobLabel: karma | ||
select0r: | ||
matchLabels: | ||
app.kubernetes.io/instance: karma | ||
namespaceSelector: | ||
matchNames: | ||
- monitoring | ||
endpoints: | ||
- path: /alerts/metrics |
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 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: prometheus-operator | ||
release: prometheus-operator | ||
name: redis | ||
namespace: monitoring | ||
spec: | ||
groups: | ||
- name: redis.memory | ||
rules: | ||
- alert: RedisMemoryAlmostFull | ||
annotations: | ||
message: 'Redis memory is at {{ $value | humanizePercentage }} of maximum for 2 days in a row' | ||
expr: redis_memory_used_bytes/redis_memory_max_bytes > 0.8 | ||
for: 2d | ||
labels: | ||
severity: warning |
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,16 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: karma | ||
namespace: monitoring | ||
spec: | ||
jobLabel: karma | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: karma | ||
namespaceSelector: | ||
matchNames: | ||
- monitoring | ||
endpoints: | ||
- path: /alerts/metrics |
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,3 @@ | ||
π©π©π©π©π©π©π© | ||
π©π© skip π©π© | ||
π©π©π©π©π©π©π© |
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 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: prometheus-operator | ||
release: prometheus-operator | ||
name: redis | ||
namespace: monitoring | ||
spec: | ||
groups: | ||
- name: redis.memory | ||
rules: | ||
- alert: RedisMemoryAlmostFull | ||
annotations: | ||
message: 'Redis memory is at {{ $value | humanizePercentage }} of maximum for 2 days in a row' | ||
expr: redis_memory_used_bytes/redis_memory_max_bytes > 0.8 | ||
for: 2d | ||
labels: | ||
severity: warning |
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,16 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: karma | ||
namespace: monitoring | ||
spec: | ||
jobLabel: karma | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: karma | ||
namespaceSelector: | ||
matchNames: | ||
- monitoring | ||
endpoints: | ||
- path: /alerts/metrics |