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

Add Helm Chart #4502

Merged
merged 20 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0a97ed1
Add Helm Chart.
desaintmartin Nov 4, 2019
2c13be1
Added dashboard-metrics-scraper support to chart per recommended depl…
davidalger Jan 2, 2020
902f6a9
Update aio/deploy/helm-chart/kubernetes-dashboard/templates/clusterro…
desaintmartin Mar 23, 2020
8f0912b
Helm chart: add metrics-server subchart and make dashboard-metrics-sc…
desaintmartin Mar 23, 2020
39a02dd
Update aio/deploy/helm-chart/kubernetes-dashboard/README.md to fix ne…
desaintmartin Mar 23, 2020
10d4ebf
Update aio/deploy/helm-chart/kubernetes-dashboard/README.md
desaintmartin Mar 23, 2020
adf4c7f
Helm chart: extract travis linting job to its own script.
desaintmartin Mar 23, 2020
9df8c97
Fix metrics-server sub-chart condition.
desaintmartin Mar 29, 2020
3a0463c
Update to 2.0.0.
desaintmartin Apr 2, 2020
a0cee9d
fix: remove unused metricsScraper.revisionHistory value and update me…
desaintmartin Apr 23, 2020
9710b52
Put dashboard resources in the right container
funkypenguin Apr 17, 2020
f1d1485
Fix container securityContext location, rename metricsScraperContaine…
desaintmartin Apr 23, 2020
13fd273
update README with metricsScraper.image.* entries
ReSearchITEng Apr 25, 2020
4da9a41
Improving breaking changes documentation and values ordering/layout i…
desaintmartin Apr 27, 2020
e71bb77
Remove unnecessary namespace declaration in ServiceAccount and Secret.
desaintmartin Apr 27, 2020
4045841
Small deployment cleanup, safer helm release script asking maintainer…
desaintmartin Apr 30, 2020
bf795c7
Upgrade to v2.0.1.
desaintmartin May 25, 2020
ddd9809
Document how to release Helm Chart.
desaintmartin May 27, 2020
f222aeb
helm-chart ignore file: Put an empty line before comments section.
desaintmartin May 29, 2020
6b28bd8
helm-chart: document the tl;dr commands.
desaintmartin May 29, 2020
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
Prev Previous commit
Next Next commit
Added dashboard-metrics-scraper support to chart per recommended depl…
…oyment

This amends work done on #4502 per request from bskim45 and as needed to support my own needs. Functionality works with a simple deployment of the metrics-server (successor to heapster):

helm install metrics-server -n kube-system stable/metrics-server
  • Loading branch information
davidalger authored and desaintmartin committed May 25, 2020
commit 2c13be10d338c361fa16b10be92a7f45128885d4
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{{/* vim: set filetype=mustache: */}}
{{/*
Common labels
*/}}
{{- define "dashboard-metrics-scraper.labels" -}}
app.kubernetes.io/name: {{ .Values.metricsScraper.name }}
helm.sh/chart: {{ include "kubernetes-dashboard.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Common label selectors
*/}}
{{- define "dashboard-metrics-scraper.matchLabels" -}}
app.kubernetes.io/name: {{ .Values.metricsScraper.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{{ if .Values.metricsScraper.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.metricsScraper.name }}
{{- with .Values.metricsScraper.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
{{ include "dashboard-metrics-scraper.labels" . | indent 4 }}
{{- if .Values.metricsScraper.labels }}
{{ toYaml .Values.metricsScraper.labels | indent 4 }}
{{- end }}
spec:
replicas: {{ .Values.metricsScraper.replicaCount }}
revisionHistoryLimit: {{ .Values.metricsScraper.revisionHistoryLimit }}
selector:
matchLabels:
{{ include "dashboard-metrics-scraper.matchLabels" . | indent 6 }}
template:
metadata:
{{- with .Values.metricsScraper.podAnnotations }}
annotations:
{{ toYaml . | indent 8 }}
{{- end }}
labels:
{{ include "dashboard-metrics-scraper.labels" . | indent 8 }}
spec:
{{- if .Values.securityContext }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "kubernetes-dashboard.serviceAccountName" . }}
containers:
- name: {{ .Values.metricsScraper.name }}
image: "{{ .Values.metricsScraper.image.repository }}:{{ .Values.metricsScraper.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
scheme: HTTP
path: /
port: 8000
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
volumeMounts:
- mountPath: /tmp
name: tmp-volume
{{- if .Values.metricsScraperContainerSecurityContext }}
securityContext:
{{ toYaml .Values.metricsScraperContainerSecurityContext | indent 10 }}
{{- end }}
{{- with .Values.metricsScraper.resources }}
resources:
{{ toYaml . | indent 10 }}
{{- end }}
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
volumes:
- name: tmp-volume
emptyDir: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{{ if .Values.metricsScraper.enabled -}}
kind: Service
apiVersion: v1
metadata:
name: {{ .Values.metricsScraper.name }}
labels:
{{ include "dashboard-metrics-scraper.labels" . | indent 4 }}
{{- if .Values.metricsScraper.labels }}
{{ toYaml .Values.metricsScraper.labels | indent 4 }}
{{- end }}
spec:
ports:
- port: 8000
targetPort: 8000
selector:
{{ include "dashboard-metrics-scraper.matchLabels" . | indent 4 }}
{{- end }}
22 changes: 22 additions & 0 deletions aio/deploy/helm-chart/kubernetes-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ resources:
cpu: 2
memory: 200Mi

metricsScraper:
enabled: true
name: dashboard-metrics-scraper
annotations: {}
labels: {}
revisionHistoryLimit: 10
podAnnotations:
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
image:
repository: kubernetesui/metrics-scraper
tag: v1.0.1
resources:
requests: {}
limits: {}

ingress:
## If true, Kubernetes Dashboard Ingress will be created.
##
Expand Down Expand Up @@ -187,5 +202,12 @@ dashboardContainerSecurityContext:
runAsUser: 1001
runAsGroup: 2001

## SecurityContext for the dashboard metrics scraper container
metricsScraperContainerSecurityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1001
runAsGroup: 2001

networkPolicy:
enabled: false