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 4 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"
32 changes: 23 additions & 9 deletions .github/workflows/reviewdog-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ name: "reviewdog - K8s manifests"
on:
pull_request:
paths:
- "charts/**"
- "k8s/**"

jobs:
kubeval-conflint:
name: runner / kubeval-conflint
runs-on: ubuntu-latest
container: mumoshu/conflint:latest
container:
image: mumoshu/conflint:latest
steps:
- uses: actions/checkout@v2
- name: kubeval-conflint
Expand All @@ -36,17 +38,29 @@ 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
container:
image: vdaas/vald-ci-container:nightly
steps:
- uses: actions/checkout@v2
- name: setup-kubelinter
- name: kubelinter for k8s directory
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
kube-linter lint \
--config .github/kubelinter.yaml \
k8s/agent \
k8s/discoverer \
k8s/gateway \
k8s/manager \
k8s/meta
kubelinter-vald-chart:
name: runner / kubelinter for vald chart
runs-on: ubuntu-latest
container:
image: vdaas/vald-ci-container:nightly
steps:
- uses: actions/checkout@v2
- name: kubelinter for generated manifests
run: |
./kube-linter lint --config .github/kubelinter.yaml k8s
kube-linter lint charts/vald
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ HELM_VERSION ?= v3.4.2
HELM_DOCS_VERSION ?= 1.4.0
VALDCLI_VERSION ?= v0.0.62
TELEPRESENCE_VERSION ?= 0.108
KUBELINTER_VERSION ?= 0.1.6

SWAP_DEPLOYMENT_TYPE ?= deployment
SWAP_IMAGE ?= ""
Expand Down
22 changes: 22 additions & 0 deletions Makefile.d/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,25 @@ telepresence/swap/backup-gateway:
## swap meta-gateway deployment using telepresence
telepresence/swap/meta-gateway:
@$(call telepresence,vald-meta-gateway,vdaas/vald-meta-gateway)

.PHONY: kubelinter/install
## install kubelinter
kubelinter/install: $(BINDIR)/kube-linter

ifeq ($(UNAME),Darwin)
$(BINDIR)/kube-linter:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -LO https://github.com/stackrox/kube-linter/releases/download/$(KUBELINTER_VERSION)/kube-linter-darwin.zip \
&& unzip kube-linter-darwin.zip \
&& chmod a+x kube-linter \
&& mv kube-linter $(BINDIR)/kube-linter
else
$(BINDIR)/kube-linter:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -LO https://github.com/stackrox/kube-linter/releases/download/$(KUBELINTER_VERSION)/kube-linter-linux.zip \
&& unzip kube-linter-linux.zip \
&& chmod a+x kube-linter \
&& mv kube-linter $(BINDIR)/kube-linter
endif
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