Skip to content

Commit

Permalink
feat: add Monokle Validation configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat committed Oct 13, 2022
1 parent 8520ea0 commit db0f239
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Test Kubernetes
on: [push]

jobs:
validate_job:
validate_kustomize:
runs-on: ubuntu-latest
permissions:
security-events: write
name: Validate with Monokle
name: Validate Kustomize with Monokle
steps:
- id: checkout
uses: actions/checkout@master
Expand All @@ -16,11 +16,40 @@ jobs:
renderEngine: "kustomize"
kustomizationPath: "./kustomize-happy-cms/overlays/local"
- id: validate
uses: kubeshop/monokle-action@v0.1.4
uses: kubeshop/monokle-action@v0.2.0
with:
path: ${{ steps.bake.outputs.manifestsBundle }}
- id: upload-sarif
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.validate.outputs.sarif }}
validate_vanilla:
runs-on: ubuntu-latest
permissions:
security-events: write
name: Validate vanilla Kubernetes resources with Monokle
steps:
- id: checkout
uses: actions/checkout@master
- id: validate
uses: kubeshop/monokle-action@v0.2.0
with:
path: vanilla-panda-blog
validate_helm:
runs-on: ubuntu-latest
permissions:
security-events: write
name: Validate Helm with Monokle
steps:
- id: checkout
uses: actions/checkout@master
- id: bake
uses: azure/k8s-bake@v2.2
with:
renderEngine: "helm"
helmChart: "./helm-yellow-wordpress"
- id: validate
uses: kubeshop/monokle-action@v0.2.0
with:
path: ${{ steps.bake.outputs.manifestsBundle }}
16 changes: 16 additions & 0 deletions monokle.validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins:
yaml-syntax: true
kubernetes-schema: true
resource-links: true
labels: false
rules:
yaml-syntax/no-bad-alias: "warn"
yaml-syntax/no-bad-directive: false
open-policy-agent/no-last-image: "err"
open-policy-agent/cpu-limit: "err"
open-policy-agent/memory-limit: "err"
open-policy-agent/memory-request: "err"
open-policy-agent/no-latest-image: "err"
settings:
kubernetes-schema:
schemaVersion: v1.24.2

0 comments on commit db0f239

Please sign in to comment.