Skip to content

Commit

Permalink
Merge pull request #2 from ironpeakservices/feat/kubelinter
Browse files Browse the repository at this point in the history
Feature: add kubelinter in CI/CD
  • Loading branch information
hazcod committed Jan 14, 2021
2 parents c95e2eb + 7e51a76 commit c697041
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/kubelinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
name: Compile Go
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Setup go
uses: actions/setup-go@v2
Expand Down
43 changes: 29 additions & 14 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ on: [pull_request]

jobs:

# k8slint:
# name: Kubernetes
# runs-on: ubuntu-latest
# steps:
# -
# uses: actions/checkout@v2
# -
# uses: makocchi-git/actions-k8s-manifests-validate-kubeval@v1.0.1
# with:
# files: kubernetes/helm/templates/
# token: ${{ secrets.GITHUB_TOKEN }}
k8slint:
name: Kubernetes
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
name: Set up Helm
uses: azure/setup-helm@v1
-
name: Compile helm chart
run: |
mkdir compiled/
helm template kubernetes/helm > compiled/all.yaml
-
uses: stackrox/kube-linter-action@v1
with:
directory: compiled/
config: .github/kubelinter.yml

golangci:
name: Go
Expand Down Expand Up @@ -47,15 +55,22 @@ jobs:
runs-on: ubuntu-latest
steps:
-
name: Check out code.
uses: actions/checkout@v2
-
name: Set up Helm
uses: azure/setup-helm@v1
-
name: Compile helm chart
run: |
mkdir compiled/
helm template kubernetes/helm > compiled/all.yaml
-
name: yamllint
uses: reviewdog/action-yamllint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
yamllint_flags: 'docker/'
yamllint_flags: 'compiled/'

hadolint:
name: Dockerfiles
Expand All @@ -70,4 +85,4 @@ jobs:
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
hadolint_flags: 'docker/'
hadolint_flags: 'kubernetes/docker/'
7 changes: 5 additions & 2 deletions kubernetes/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ spec:
{{ end }}

resources:
requests:
cpu: 0.1
memory: 200Mi
limits:
cpu: 0.5
memory: 300Mi
cpu: 1
memory: 1Gi

securityContext:
readOnlyRootFilesystem: true
Expand Down
3 changes: 3 additions & 0 deletions kubernetes/helm/templates/tests/service.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
args: ['-O/dev/null', '-q', '{{ .Values.name }}:{{ .Values.servicePort }}']

resources:
requests:
cpu: 0.1
memory: 50Mi
limits:
cpu: 100m
memory: 64Mi
Expand Down

0 comments on commit c697041

Please sign in to comment.