Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default run as nonroot #733

Merged
merged 4 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cost-analyzer/charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ alertmanager:
## Security context to be added to alertmanager pods
##
securityContext:
runAsUser: 65534
runAsUser: 1001
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
runAsGroup: 1001
fsGroup: 1001

service:
annotations: {}
Expand Down Expand Up @@ -856,10 +856,10 @@ server:
## Security context to be added to server pods
##
securityContext:
runAsUser: 65534
runAsUser: 1001
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
runAsGroup: 1001
fsGroup: 1001

service:
annotations: {}
Expand Down Expand Up @@ -1016,7 +1016,7 @@ pushgateway:
## Security context to be added to push-gateway pods
##
securityContext:
runAsUser: 65534
runAsUser: 1001
runAsNonRoot: true

service:
Expand Down
30 changes: 25 additions & 5 deletions cost-analyzer/charts/thanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ store:
# hosts:
# - chart-example.local
# Optional securityContext
securityContext: {}
securityContext:
fsGroup: 1001
runAsNonRoot: true
runAsUser: 1001

resources: {}
# limits:
# cpu: 2000m
Expand Down Expand Up @@ -265,7 +269,11 @@ queryFrontend:
labels: {}

# Optional securityContext
securityContext: {}
securityContext:
fsGroup: 1001
runAsNonRoot: true
runAsUser: 1001

resources: {}
# limits:
# cpu: 2000m
Expand Down Expand Up @@ -424,7 +432,11 @@ query:
labels: {}

# Optional securityContext
securityContext: {}
securityContext:
fsGroup: 1001
runAsNonRoot: true
runAsUser: 1001

resources: {}
# limits:
# cpu: 2000m
Expand Down Expand Up @@ -547,7 +559,11 @@ compact:
serviceAccount: ""

# Optional securityContext
securityContext: {}
securityContext:
fsGroup: 1001
runAsNonRoot: true
runAsUser: 1001

resources: {}
# limits:
# cpu: 2000m
Expand Down Expand Up @@ -646,7 +662,11 @@ bucket:
# maxUnavailable: 50%

# Optional securityContext
securityContext: {}
securityContext:
fsGroup: 1001
runAsNonRoot: true
runAsUser: 1001

resources: {}
# limits:
# cpu: 2000m
Expand Down
3 changes: 3 additions & 0 deletions cost-analyzer/templates/cost-analyzer-checks-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ spec:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 1001
{{- end -}}
{{- end -}}
6 changes: 1 addition & 5 deletions cost-analyzer/templates/cost-analyzer-psp.template.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{{- if .Values.podSecurityPolicy }}
{{- if .Values.podSecurityPolicy.enabled }}
apiVersion: {{ include "cost-analyzer.podSecurityPolicy.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: kubecost-cost-analyzer-psp
spec:
privileged: true
privileged: false
seLinux:
rule: RunAsAny
supplementalGroups:
Expand All @@ -16,5 +14,3 @@ spec:
rule: RunAsAny
volumes:
- '*'
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions cost-analyzer/values-thanos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ prometheus:
storage.tsdb.min-block-duration: 2h
storage.tsdb.max-block-duration: 2h
storage.tsdb.retention: 2w
securityContext:
runAsNonRoot: true
runAsUser: 1001
extraVolumes:
- name: object-store-volume
secret:
Expand All @@ -26,6 +29,9 @@ prometheus:
sidecarContainers:
- name: thanos-sidecar
image: thanosio/thanos:v0.15.0
securityContext:
runAsNonRoot: true
runAsUser: 1001
args:
- sidecar
- --log.level=debug
Expand Down
2 changes: 1 addition & 1 deletion cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ prometheusRule:
enabled: false
additionalLabels: {}

supportNFS: true
supportNFS: false
# initChownDataImage ensures all Kubecost filepath permissions on PV or local storage are set up correctly.
initChownDataImage: "busybox" # Supports a fully qualified Docker image, e.g. registry.hub.docker.com/library/busybox:latest
initChownData:
Expand Down