155 lines
5.3 KiB
YAML
155 lines
5.3 KiB
YAML
# 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 and .Values.metricsScraper.enabled (eq .Values.app.mode "dashboard") }}
|
|
|
|
kind: Deployment
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
labels:
|
|
{{- include "kubernetes-dashboard.labels" . | nindent 4 }}
|
|
{{- with .Values.metricsScraper.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
app.kubernetes.io/name: {{ template "kubernetes-dashboard.name" . }}-{{ .Values.metricsScraper.role }}
|
|
app.kubernetes.io/version: {{ .Values.metricsScraper.image.tag }}
|
|
app.kubernetes.io/component: {{ .Values.metricsScraper.role }}
|
|
annotations:
|
|
{{- include "kubernetes-dashboard.annotations" . | nindent 4 }}
|
|
{{- with .Values.metricsScraper.annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
name: {{ template "kubernetes-dashboard.metrics-scraper.name" . }}
|
|
spec:
|
|
replicas: {{ .Values.metricsScraper.scaling.replicas }}
|
|
revisionHistoryLimit: {{ .Values.metricsScraper.scaling.revisionHistoryLimit }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "kubernetes-dashboard.matchLabels" . | nindent 6 }}
|
|
app.kubernetes.io/name: {{ template "kubernetes-dashboard.name" . }}-{{ .Values.metricsScraper.role }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "kubernetes-dashboard.labels" . | nindent 8 }}
|
|
{{- with .Values.metricsScraper.labels }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
app.kubernetes.io/name: {{ template "kubernetes-dashboard.name" . }}-{{ .Values.metricsScraper.role }}
|
|
app.kubernetes.io/version: {{ .Values.metricsScraper.image.tag }}
|
|
app.kubernetes.io/component: {{ .Values.metricsScraper.role }}
|
|
annotations:
|
|
{{- with .Values.metricsScraper.annotations }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
containers:
|
|
- name: {{ template "kubernetes-dashboard.name" . }}-{{ .Values.metricsScraper.role }}
|
|
image: "{{ .Values.metricsScraper.image.repository }}:{{ .Values.metricsScraper.image.tag }}"
|
|
imagePullPolicy: {{ .Values.app.image.pullPolicy }}
|
|
{{- with .Values.metricsScraper.containers.args }}
|
|
args:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
env:
|
|
{{- if .Values.metricsScraper.containers.resources.limits.cpu }}
|
|
- name: GOMAXPROCS
|
|
valueFrom:
|
|
resourceFieldRef:
|
|
resource: limits.cpu
|
|
divisor: "1"
|
|
{{- end }}
|
|
{{- if .Values.metricsScraper.containers.resources.limits.memory }}
|
|
- name: GOMEMLIMIT
|
|
valueFrom:
|
|
resourceFieldRef:
|
|
resource: limits.memory
|
|
divisor: "1"
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.containers.env }}
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.containers.ports }}
|
|
ports:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.containers.volumeMounts }}
|
|
volumeMounts:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.app.security.containerSecurityContext }}
|
|
securityContext:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.containers.resources }}
|
|
resources:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.containers.livenessProbe }}
|
|
livenessProbe:
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.app.image.pullSecrets }}
|
|
imagePullSecrets:
|
|
{{- range . }}
|
|
- name: {{ . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
automountServiceAccountToken: {{ .Values.metricsScraper.automountServiceAccountToken }}
|
|
|
|
{{- with .Values.app.security.securityContext }}
|
|
securityContext:
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.metricsScraper.volumes }}
|
|
volumes:
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.app.priorityClassName }}
|
|
priorityClassName: {{ . }}
|
|
{{- end }}
|
|
|
|
{{- if or .Values.metricsScraper.nodeSelector .Values.app.scheduling.nodeSelector }}
|
|
nodeSelector:
|
|
{{- with .Values.metricsScraper.nodeSelector }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.app.scheduling.nodeSelector }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.app.tolerations }}
|
|
tolerations:
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|
|
{{- with .Values.app.affinity }}
|
|
affinity:
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ template "kubernetes-dashboard.fullname" . }}-{{ .Values.metricsScraper.role }}
|
|
{{ end }}
|