Skip to content

Commit

Permalink
cleaning up default config, fixing a small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
robscott committed Apr 5, 2019
1 parent 9cfd2b6 commit b332772
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 49 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resources:
cpuRequestsMissing: error
cpuLimitsMissing: error
memoryRequestsMissing: error
memoryLimitsMissing: error
images:
tagNotSpecified: error
healthChecks:
readinessProbeMissing: warning
livenessProbeMissing: warning
networking:
hostAliasSet: error
hostIPCSet: error
hostNetworkSet: error
hostPIDSet: error
hostPortSet: error
security:
runAsRootAllowed: warning
runAsPrivileged: error
notReadOnlyRootFileSystem: warning
privilegeEscalationAllowed: error
capabilities:
error:
ifAnyAdded:
- CAP_SYS_ADMIN
- CAP_NET_ADMIN
- ALL
warning:
ifAnyAddedBeyond:
- NONE
56 changes: 10 additions & 46 deletions deploy/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,49 +74,14 @@ metadata:
labels:
app: fairwinds
data:
config.yml: |
config.yaml: |
resources:
cpuRequestsMissing: warning
cpuRequestRanges:
warning:
below: 50m
above: 1000m
error:
below: 500m
above: 2000m
cpuLimitsMissing: warning
cpuLimitRanges:
warning:
below: 50m
above: 1000m
error:
below: 500m
above: 2000m
memoryRequestsMissing: warning
memoryRequestRanges:
warning:
below: 50M
above: 2G
error:
below: 100M
above: 4G
memoryLimitsMissing: warning
memoryLimitRanges:
warning:
below: 50M
above: 2G
error:
below: 100M
above: 4G
cpuRequestsMissing: error
cpuLimitsMissing: error
memoryRequestsMissing: error
memoryLimitsMissing: error
images:
tagNotSpecified: error
pullPolicyNotAlways: warning
whitelist:
error:
- gcr.io/*
blacklist:
warning:
- docker.io/*
healthChecks:
readinessProbeMissing: warning
livenessProbeMissing: warning
Expand All @@ -135,8 +100,7 @@ data:
error:
ifAnyAdded:
- CAP_SYS_ADMIN
- ALL
ifAnyNotDropped:
- CAP_NET_ADMIN
- ALL
warning:
ifAnyAddedBeyond:
Expand Down Expand Up @@ -178,8 +142,8 @@ spec:
- name: certs
mountPath: /tmp/cert/
- name: fairwinds
mountPath: /opt/app/config.yml
subPath: config.yml
mountPath: /opt/app/config.yaml
subPath: config.yaml
readOnly: true
- name: dashboard
image: quay.io/reactiveops/fairwinds
Expand All @@ -196,8 +160,8 @@ spec:
memory: 128Mi
volumeMounts:
- name: fairwinds
mountPath: /opt/app/config.yml
subPath: config.yml
mountPath: /opt/app/config.yaml
subPath: config.yaml
readOnly: true
volumes:
- name: fairwinds
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func main() {

flag.Parse()

c, err := conf.ParseFile("config.yml")
c, err := conf.ParseFile("config.yaml")
if err != nil {
glog.Println("Error parsing config.yml:", err)
glog.Println("Error parsing config.yaml:", err)
os.Exit(1)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/validator/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ func addResult(resResult ResourceResult, nsResults NamespacedResults, nsName str
// Aggregate all resource results summary counts to get a namespace wide count.
nsResult.Summary.Successes += resResult.Summary.Successes
nsResult.Summary.Warnings += resResult.Summary.Warnings
nsResult.Summary.Errors += resResult.Summary.Successes
nsResult.Summary.Errors += resResult.Summary.Errors
return nsResults
}

0 comments on commit b332772

Please sign in to comment.