Update action (refactorings) (#5)

This commit is contained in:
msugakov
2021-05-10 17:57:13 +02:00
committed by GitHub
parent 0aa052e480
commit f269162ccb
8 changed files with 180 additions and 37 deletions
-19
View File
@@ -1,19 +0,0 @@
name: Check Kubernetes YAMLs
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Scan repo
id: kube-lint-repo
uses: stackrox/kube-linter-action@v1.0.0
with:
directory: yaml
#config: .kube-linter/config.yaml
+17
View File
@@ -0,0 +1,17 @@
# customChecks defines custom checks.
customChecks:
- name: "required-annotation-team"
template: "required-annotation"
params:
key: "team"
remediation: "Add a team annotation to your object"
checks:
# if doNotAutoAddDefaults is true, default checks are not automatically added.
doNotAutoAddDefaults: false
# include explicitly adds checks, by name. You can reference any of the built-in checks.
# Note that customChecks defined above are included automatically.
include: [ ]
# exclude explicitly excludes checks, by name. exclude has the highest priority: if a check is
# in exclude, then it is not considered, even if it is in include as well.
exclude: [ ]
@@ -15,7 +15,7 @@ spec:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
+45
View File
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: compliant
namespace: my-namespace
annotations:
team: database
spec:
replicas: 1
minReadySeconds: 15
selector:
matchLabels:
app: compliant
strategy:
type: Recreate
template:
metadata:
namespace: my-namespace
labels:
app: compliant
spec:
serviceAccountName: my-service-account
containers:
- image: nginx:latest
name: nginx
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
resources:
requests:
memory: "1Gi"
cpu: "1"
limits:
memory: "4Gi"
cpu: "2"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-service-account
namespace: my-namespace
labels:
app.kubernetes.io/name: my-app
annotations:
team: database