diff --git a/.github/kubelinter.yml b/.github/kubelinter.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/kubelinter.yml @@ -0,0 +1 @@ + diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index 7e253ab..c84cdbf 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -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 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 86f51e3..fceee4a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -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 @@ -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 @@ -70,4 +85,4 @@ jobs: with: github_token: ${{ secrets.github_token }} reporter: github-pr-review - hadolint_flags: 'docker/' + hadolint_flags: 'kubernetes/docker/' diff --git a/kubernetes/helm/templates/deployment.yaml b/kubernetes/helm/templates/deployment.yaml index b58329a..5bae85a 100644 --- a/kubernetes/helm/templates/deployment.yaml +++ b/kubernetes/helm/templates/deployment.yaml @@ -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 diff --git a/kubernetes/helm/templates/tests/service.test.yaml b/kubernetes/helm/templates/tests/service.test.yaml index cfbf857..80202a7 100644 --- a/kubernetes/helm/templates/tests/service.test.yaml +++ b/kubernetes/helm/templates/tests/service.test.yaml @@ -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