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

revise kubelinter config / Add securityContext section to Helm chart #833

Merged
merged 5 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .github/kubelinter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ checks:
exclude:
- "unset-cpu-requirements"
- "unset-memory-requirements"
- "no-read-only-root-fs"
30 changes: 27 additions & 3 deletions .github/workflows/reviewdog-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ name: "reviewdog - K8s manifests"
on:
pull_request:
paths:
- "charts/**"
- "k8s/**"

jobs:
Expand All @@ -36,7 +37,7 @@ jobs:
CONFLINT_LOG: DEBUG
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPORTER: github-pr-review
kubelinter:
kubelinter-k8s-manifests:
name: runner / kubelinter
runs-on: ubuntu-latest
steps:
Expand All @@ -47,6 +48,29 @@ jobs:
unzip kube-linter-linux.zip
env:
KUBELINTER_VERSION: 0.1.2
- name: kubelinter
- name: kubelinter for k8s directory
run: |
./kube-linter lint --config .github/kubelinter.yaml k8s
./kube-linter lint \
kpango marked this conversation as resolved.
Show resolved Hide resolved
--config .github/kubelinter.yaml \
k8s/agent \
k8s/discoverer \
k8s/gateway \
k8s/manager \
k8s/meta
kubelinter-generated-manifests:
name: runner / kubelinter for generated manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup-kubelinter
run: |
wget https://github.com/stackrox/kube-linter/releases/download/${KUBELINTER_VERSION}/kube-linter-linux.zip
unzip kube-linter-linux.zip
env:
KUBELINTER_VERSION: 0.1.2
- name: kubelinter for generated manifests
run: |
helm template --output-dir tmp-k8s charts/vald
./kube-linter lint \
--config .github/kubelinter.yaml \
tmp-k8s
5 changes: 4 additions & 1 deletion charts/vald/templates/agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if .Values.agent.securityContext }}
securityContext:
{{- toYaml .Values.agent.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.agent.terminationGracePeriodSeconds }}
volumes:
- name: {{ .Values.agent.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if .Values.agent.securityContext }}
securityContext:
{{- toYaml .Values.agent.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.agent.terminationGracePeriodSeconds }}
volumes:
- name: {{ .Values.agent.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/agent/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if .Values.agent.securityContext }}
securityContext:
{{- toYaml .Values.agent.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.agent.terminationGracePeriodSeconds }}
volumes:
- name: {{ .Values.agent.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/discoverer/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ spec:
schedulerName: default-scheduler
serviceAccount: vald
serviceAccountName: vald
securityContext: {}
{{- if $discoverer.securityContext }}
securityContext:
{{- toYaml $discoverer.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $discoverer.terminationGracePeriodSeconds }}
volumes:
- name: {{ $discoverer.name }}-config
Expand Down
9 changes: 6 additions & 3 deletions charts/vald/templates/discoverer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccount: vald
serviceAccountName: vald
securityContext: {}
serviceAccount: {{ $discoverer.serviceAccount.name }}
serviceAccountName: {{ $discoverer.serviceAccount.name }}
{{- if $discoverer.securityContext }}
securityContext:
{{- toYaml $discoverer.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $discoverer.terminationGracePeriodSeconds }}
volumes:
- name: {{ $discoverer.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/backup/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/backup/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/lb/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/lb/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/meta/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/meta/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/vald/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/gateway/vald/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $gateway.securityContext }}
securityContext:
{{- toYaml $gateway.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }}
volumes:
- name: {{ $gateway.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/backup/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $backup.securityContext }}
securityContext:
{{- toYaml $backup.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $backup.terminationGracePeriodSeconds }}
volumes:
- name: {{ $backup.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/backup/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $backup.securityContext }}
securityContext:
{{- toYaml $backup.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $backup.terminationGracePeriodSeconds }}
volumes:
- name: {{ $backup.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/compressor/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $compressor.securityContext }}
securityContext:
{{- toYaml $compressor.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $compressor.terminationGracePeriodSeconds }}
volumes:
- configMap:
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/compressor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $compressor.securityContext }}
securityContext:
{{- toYaml $compressor.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $compressor.terminationGracePeriodSeconds }}
volumes:
- configMap:
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/index/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $index.securityContext }}
securityContext:
{{- toYaml $index.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $index.terminationGracePeriodSeconds }}
volumes:
- configMap:
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/manager/index/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $index.securityContext }}
securityContext:
{{- toYaml $index.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $index.terminationGracePeriodSeconds }}
volumes:
- configMap:
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/meta/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $meta.securityContext }}
securityContext:
{{- toYaml $meta.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $meta.terminationGracePeriodSeconds }}
volumes:
- name: {{ $meta.name }}-config
Expand Down
5 changes: 4 additions & 1 deletion charts/vald/templates/meta/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
{{- if $meta.securityContext }}
securityContext:
{{- toYaml $meta.securityContext | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ $meta.terminationGracePeriodSeconds }}
volumes:
- name: {{ $meta.name }}-config
Expand Down
2 changes: 1 addition & 1 deletion charts/vald/values.schema.json

Large diffs are not rendered by default.

Loading