Canary deployments for fission functions. (#892)
This commit is contained in:
Executable
+100
@@ -0,0 +1,100 @@
|
||||
The Prometheus server can be accessed via port {{ .Values.server.service.servicePort }} on the following DNS name from within your cluster:
|
||||
{{ template "prometheus.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
{{ if .Values.server.ingress.enabled -}}
|
||||
From outside the cluster, the server URL(s) are:
|
||||
{{- range .Values.server.ingress.hosts }}
|
||||
http://{{ . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
Get the Prometheus server URL by running these commands in the same shell:
|
||||
{{- if contains "NodePort" .Values.server.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus.server.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.server.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus.server.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus.server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo http://$SERVICE_IP:{{ .Values.server.service.servicePort }}
|
||||
{{- else if contains "ClusterIP" .Values.server.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "prometheus.name" . }},component={{ .Values.server.name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9090
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.server.persistentVolume.enabled }}
|
||||
{{- else }}
|
||||
#################################################################################
|
||||
###### WARNING: Persistence is disabled!!! You will lose your data when #####
|
||||
###### the Server pod is terminated. #####
|
||||
#################################################################################
|
||||
{{- end }}
|
||||
|
||||
{{ if .Values.alertmanager.enabled }}
|
||||
The Prometheus alertmanager can be accessed via port {{ .Values.alertmanager.service.servicePort }} on the following DNS name from within your cluster:
|
||||
{{ template "prometheus.alertmanager.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
{{ if .Values.alertmanager.ingress.enabled -}}
|
||||
From outside the cluster, the alertmanager URL(s) are:
|
||||
{{- range .Values.alertmanager.ingress.hosts }}
|
||||
http://{{ . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
Get the Alertmanager URL by running these commands in the same shell:
|
||||
{{- if contains "NodePort" .Values.alertmanager.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus.alertmanager.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.alertmanager.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus.alertmanager.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus.alertmanager.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo http://$SERVICE_IP:{{ .Values.alertmanager.service.servicePort }}
|
||||
{{- else if contains "ClusterIP" .Values.alertmanager.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "prometheus.name" . }},component={{ .Values.alertmanager.name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9093
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.alertmanager.persistentVolume.enabled }}
|
||||
{{- else }}
|
||||
#################################################################################
|
||||
###### WARNING: Persistence is disabled!!! You will lose your data when #####
|
||||
###### the AlertManager pod is terminated. #####
|
||||
#################################################################################
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if .Values.pushgateway.enabled }}
|
||||
The Prometheus PushGateway can be accessed via port {{ .Values.pushgateway.service.servicePort }} on the following DNS name from within your cluster:
|
||||
{{ template "prometheus.pushgateway.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
{{ if .Values.pushgateway.ingress.enabled -}}
|
||||
From outside the cluster, the pushgateway URL(s) are:
|
||||
{{- range .Values.pushgateway.ingress.hosts }}
|
||||
http://{{ . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
Get the PushGateway URL by running these commands in the same shell:
|
||||
{{- if contains "NodePort" .Values.pushgateway.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus.pushgateway.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.pushgateway.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus.pushgateway.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus.pushgateway.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo http://$SERVICE_IP:{{ .Values.pushgateway.service.servicePort }}
|
||||
{{- else if contains "ClusterIP" .Values.pushgateway.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "prometheus.name" . }},component={{ .Values.pushgateway.name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9091
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
For more information on running Prometheus, visit:
|
||||
https://prometheus.io/
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "prometheus.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "prometheus.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified alertmanager name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
|
||||
{{- define "prometheus.alertmanager.fullname" -}}
|
||||
{{- if .Values.alertmanager.fullnameOverride -}}
|
||||
{{- .Values.alertmanager.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- printf "%s-%s" .Release.Name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified kube-state-metrics name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "prometheus.kubeStateMetrics.fullname" -}}
|
||||
{{- if .Values.kubeStateMetrics.fullnameOverride -}}
|
||||
{{- .Values.kubeStateMetrics.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- printf "%s-%s" .Release.Name .Values.kubeStateMetrics.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.kubeStateMetrics.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified node-exporter name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "prometheus.nodeExporter.fullname" -}}
|
||||
{{- if .Values.nodeExporter.fullnameOverride -}}
|
||||
{{- .Values.nodeExporter.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- printf "%s-%s" .Release.Name .Values.nodeExporter.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.nodeExporter.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified Prometheus server name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "prometheus.server.fullname" -}}
|
||||
{{- if .Values.server.fullnameOverride -}}
|
||||
{{- .Values.server.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- printf "%s-%s" .Release.Name .Values.server.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.server.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified pushgateway name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "prometheus.pushgateway.fullname" -}}
|
||||
{{- if .Values.pushgateway.fullnameOverride -}}
|
||||
{{- .Values.pushgateway.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- printf "%s-%s" .Release.Name .Values.pushgateway.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.pushgateway.name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for networkpolicy.
|
||||
*/}}
|
||||
{{- define "prometheus.networkPolicy.apiVersion" -}}
|
||||
{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use for the alertmanager component
|
||||
*/}}
|
||||
{{- define "prometheus.serviceAccountName.alertmanager" -}}
|
||||
{{- if .Values.serviceAccounts.alertmanager.create -}}
|
||||
{{ default (include "prometheus.alertmanager.fullname" .) .Values.serviceAccounts.alertmanager.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccounts.alertmanager.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use for the kubeStateMetrics component
|
||||
*/}}
|
||||
{{- define "prometheus.serviceAccountName.kubeStateMetrics" -}}
|
||||
{{- if .Values.serviceAccounts.kubeStateMetrics.create -}}
|
||||
{{ default (include "prometheus.kubeStateMetrics.fullname" .) .Values.serviceAccounts.kubeStateMetrics.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccounts.kubeStateMetrics.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use for the nodeExporter component
|
||||
*/}}
|
||||
{{- define "prometheus.serviceAccountName.nodeExporter" -}}
|
||||
{{- if .Values.serviceAccounts.nodeExporter.create -}}
|
||||
{{ default (include "prometheus.nodeExporter.fullname" .) .Values.serviceAccounts.nodeExporter.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccounts.nodeExporter.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use for the pushgateway component
|
||||
*/}}
|
||||
{{- define "prometheus.serviceAccountName.pushgateway" -}}
|
||||
{{- if .Values.serviceAccounts.pushgateway.create -}}
|
||||
{{ default (include "prometheus.pushgateway.fullname" .) .Values.serviceAccounts.pushgateway.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccounts.pushgateway.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use for the server component
|
||||
*/}}
|
||||
{{- define "prometheus.serviceAccountName.server" -}}
|
||||
{{- if .Values.serviceAccounts.server.create -}}
|
||||
{{ default (include "prometheus.server.fullname" .) .Values.serviceAccounts.server.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccounts.server.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- if and .Values.alertmanager.enabled (empty .Values.alertmanager.configMapOverrideName) -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
data:
|
||||
{{- $root := . -}}
|
||||
{{- range $key, $value := .Values.alertmanagerFiles }}
|
||||
{{ $key }}: |
|
||||
{{ toYaml $value | default "{}" | indent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,115 @@
|
||||
{{- if .Values.alertmanager.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
spec:
|
||||
replicas: {{ .Values.alertmanager.replicaCount }}
|
||||
{{- if .Values.server.strategy }}
|
||||
strategy:
|
||||
{{ toYaml .Values.server.strategy | indent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.alertmanager.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.alertmanager.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{- if .Values.alertmanager.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.alertmanager.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.schedulerName }}
|
||||
schedulerName: "{{ .Values.alertmanager.schedulerName }}"
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "prometheus.serviceAccountName.alertmanager" . }}
|
||||
{{- if .Values.alertmanager.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.alertmanager.priorityClassName }}"
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}
|
||||
image: "{{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.alertmanager.image.pullPolicy }}"
|
||||
env:
|
||||
{{- range $key, $value := .Values.alertmanager.extraEnv }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $value }}
|
||||
{{- end }}
|
||||
args:
|
||||
- --config.file=/etc/config/alertmanager.yml
|
||||
- --storage.path={{ .Values.alertmanager.persistentVolume.mountPath }}
|
||||
{{- range $key, $value := .Values.alertmanager.extraArgs }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.baseURL }}
|
||||
- --web.external-url={{ .Values.alertmanager.baseURL }}
|
||||
{{- end }}
|
||||
|
||||
ports:
|
||||
- containerPort: 9093
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.alertmanager.prefixURL }}/#/status
|
||||
port: 9093
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 30
|
||||
resources:
|
||||
{{ toYaml .Values.alertmanager.resources | indent 12 }}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config
|
||||
- name: storage-volume
|
||||
mountPath: "{{ .Values.alertmanager.persistentVolume.mountPath }}"
|
||||
subPath: "{{ .Values.alertmanager.persistentVolume.subPath }}"
|
||||
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}-{{ .Values.configmapReload.name }}
|
||||
image: "{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}"
|
||||
args:
|
||||
- --volume-dir=/etc/config
|
||||
- --webhook-url=http://localhost:9093{{ .Values.alertmanager.prefixURL }}/-/reload
|
||||
resources:
|
||||
{{ toYaml .Values.configmapReload.resources | indent 12 }}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config
|
||||
readOnly: true
|
||||
{{- if .Values.alertmanager.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.alertmanager.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.alertmanager.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.alertmanager.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.alertmanager.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: {{ if .Values.alertmanager.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.alertmanager.configMapOverrideName }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
|
||||
- name: storage-volume
|
||||
{{- if .Values.alertmanager.persistentVolume.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,38 @@
|
||||
{{- if and .Values.alertmanager.enabled .Values.alertmanager.ingress.enabled -}}
|
||||
{{- $releaseName := .Release.Name -}}
|
||||
{{- $serviceName := include "prometheus.alertmanager.fullname" . }}
|
||||
{{- $servicePort := .Values.alertmanager.service.servicePort -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.alertmanager.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.alertmanager.ingress.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- range $key, $value := .Values.alertmanager.ingress.extraLabels }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
spec:
|
||||
rules:
|
||||
{{- range .Values.alertmanager.ingress.hosts }}
|
||||
{{- $url := splitList "/" . }}
|
||||
- host: {{ first $url }}
|
||||
http:
|
||||
paths:
|
||||
- path: /{{ rest $url | join "/" }}
|
||||
backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end -}}
|
||||
{{- if .Values.alertmanager.ingress.tls }}
|
||||
tls:
|
||||
{{ toYaml .Values.alertmanager.ingress.tls | indent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
apiVersion: {{ template "prometheus.networkPolicy.apiVersion" . }}
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
release: {{ .Release.Name }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
- ports:
|
||||
- port: 9093
|
||||
{{- end }}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
{{- if and .Values.alertmanager.enabled .Values.alertmanager.persistentVolume.enabled -}}
|
||||
{{- if not .Values.alertmanager.persistentVolume.existingClaim -}}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
{{- if .Values.alertmanager.persistentVolume.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.alertmanager.persistentVolume.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{ toYaml .Values.alertmanager.persistentVolume.accessModes | indent 4 }}
|
||||
{{- if .Values.alertmanager.persistentVolume.storageClass }}
|
||||
{{- if (eq "-" .Values.alertmanager.persistentVolume.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.alertmanager.persistentVolume.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: "{{ .Values.alertmanager.persistentVolume.size }}"
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{- if .Values.alertmanager.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.alertmanager.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.alertmanager.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.alertmanager.service.labels }}
|
||||
{{ toYaml .Values.alertmanager.service.labels | indent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.alertmanager.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.alertmanager.service.clusterIP }}
|
||||
clusterIP: {{ .Values.alertmanager.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.alertmanager.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.alertmanager.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.alertmanager.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.alertmanager.service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: 9093
|
||||
{{- if .Values.alertmanager.service.nodePort }}
|
||||
nodePort: {{ .Values.alertmanager.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- if .Values.alertmanager.service.enableMeshPeer }}
|
||||
- name: meshpeer
|
||||
port: 6783
|
||||
protocol: TCP
|
||||
targetPort: 6783
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
type: "{{ .Values.alertmanager.service.type }}"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccounts.alertmanager.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.alertmanager.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.serviceAccountName.alertmanager" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,64 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
- nodes
|
||||
- persistentvolumeclaims
|
||||
- pods
|
||||
- services
|
||||
- resourcequotas
|
||||
- replicationcontrollers
|
||||
- limitranges
|
||||
- persistentvolumeclaims
|
||||
- persistentvolumes
|
||||
- endpoints
|
||||
- secrets
|
||||
- configmaps
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- extensions
|
||||
resources:
|
||||
- daemonsets
|
||||
- deployments
|
||||
- replicasets
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- statefulsets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- batch
|
||||
resources:
|
||||
- cronjobs
|
||||
- jobs
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- autoscaling
|
||||
resources:
|
||||
- horizontalpodautoscalers
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
{{- end }}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "prometheus.serviceAccountName.kubeStateMetrics" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,67 @@
|
||||
{{- if .Values.kubeStateMetrics.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- if .Values.kubeStateMetrics.deploymentAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.kubeStateMetrics.deploymentAnnotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
spec:
|
||||
replicas: {{ .Values.kubeStateMetrics.replicaCount }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.kubeStateMetrics.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.kubeStateMetrics.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.kubeStateMetrics.pod.labels }}
|
||||
{{ toYaml .Values.kubeStateMetrics.pod.labels | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "prometheus.serviceAccountName.kubeStateMetrics" . }}
|
||||
{{- if .Values.kubeStateMetrics.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.kubeStateMetrics.priorityClassName }}"
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.kubeStateMetrics.name }}
|
||||
image: "{{ .Values.kubeStateMetrics.image.repository }}:{{ .Values.kubeStateMetrics.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.kubeStateMetrics.image.pullPolicy }}"
|
||||
{{- if .Values.kubeStateMetrics.args }}
|
||||
args:
|
||||
{{- range $key, $value := .Values.kubeStateMetrics.args }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 8080
|
||||
resources:
|
||||
{{ toYaml .Values.kubeStateMetrics.resources | indent 12 }}
|
||||
{{- if .Values.kubeStateMetrics.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.kubeStateMetrics.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.kubeStateMetrics.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.kubeStateMetrics.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.kubeStateMetrics.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
apiVersion: {{ template "prometheus.networkPolicy.apiVersion" . }}
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
release: {{ .Release.Name }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
- ports:
|
||||
- port: 8080
|
||||
{{- end }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccounts.kubeStateMetrics.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.serviceAccountName.kubeStateMetrics" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- if .Values.kubeStateMetrics.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.kubeStateMetrics.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.kubeStateMetrics.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.kubeStateMetrics.service.labels }}
|
||||
{{ toYaml .Values.kubeStateMetrics.service.labels | indent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.kubeStateMetrics.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.kubeStateMetrics.service.clusterIP }}
|
||||
clusterIP: {{ .Values.kubeStateMetrics.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.kubeStateMetrics.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.kubeStateMetrics.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.kubeStateMetrics.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.kubeStateMetrics.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.kubeStateMetrics.service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.kubeStateMetrics.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
type: "{{ .Values.kubeStateMetrics.service.type }}"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,108 @@
|
||||
{{- if .Values.nodeExporter.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
{{- if .Values.nodeExporter.deploymentAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.nodeExporter.deploymentAnnotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.nodeExporter.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.nodeExporter.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.nodeExporter.updateStrategy }}
|
||||
updateStrategy:
|
||||
{{ toYaml .Values.nodeExporter.updateStrategy | indent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.nodeExporter.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.nodeExporter.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.nodeExporter.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.nodeExporter.pod.labels }}
|
||||
{{ toYaml .Values.nodeExporter.pod.labels | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "prometheus.serviceAccountName.nodeExporter" . }}
|
||||
{{- if .Values.nodeExporter.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.nodeExporter.priorityClassName }}"
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.nodeExporter.name }}
|
||||
image: "{{ .Values.nodeExporter.image.repository }}:{{ .Values.nodeExporter.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.nodeExporter.image.pullPolicy }}"
|
||||
args:
|
||||
- --path.procfs=/host/proc
|
||||
- --path.sysfs=/host/sys
|
||||
{{- range $key, $value := .Values.nodeExporter.extraArgs }}
|
||||
{{- if $value }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- else }}
|
||||
- --{{ $key }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9100
|
||||
hostPort: {{ .Values.nodeExporter.service.hostPort }}
|
||||
resources:
|
||||
{{ toYaml .Values.nodeExporter.resources | indent 12 }}
|
||||
volumeMounts:
|
||||
- name: proc
|
||||
mountPath: /host/proc
|
||||
readOnly: true
|
||||
- name: sys
|
||||
mountPath: /host/sys
|
||||
readOnly: true
|
||||
{{- range .Values.nodeExporter.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- range .Values.nodeExporter.extraConfigmapMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
hostNetwork: true
|
||||
hostPID: true
|
||||
{{- if .Values.nodeExporter.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.nodeExporter.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeExporter.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.nodeExporter.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeExporter.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.nodeExporter.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: proc
|
||||
hostPath:
|
||||
path: /proc
|
||||
- name: sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
{{- range .Values.nodeExporter.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
{{- end }}
|
||||
{{- range .Values.nodeExporter.extraConfigmapMounts }}
|
||||
- name: {{ .name }}
|
||||
configMap:
|
||||
name: {{ .configMap }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- if .Values.nodeExporter.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.nodeExporter.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.nodeExporter.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.nodeExporter.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.nodeExporter.service.labels }}
|
||||
{{ toYaml .Values.nodeExporter.service.labels | indent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.nodeExporter.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.nodeExporter.service.clusterIP }}
|
||||
clusterIP: {{ .Values.nodeExporter.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeExporter.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.nodeExporter.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeExporter.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.nodeExporter.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeExporter.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.nodeExporter.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
port: {{ .Values.nodeExporter.service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: 9100
|
||||
selector:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.nodeExporter.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
type: "{{ .Values.nodeExporter.service.type }}"
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccounts.nodeExporter.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.nodeExporter.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.serviceAccountName.nodeExporter" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,67 @@
|
||||
{{- if .Values.pushgateway.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.pushgateway.fullname" . }}
|
||||
spec:
|
||||
replicas: {{ .Values.pushgateway.replicaCount }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.pushgateway.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.pushgateway.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "prometheus.serviceAccountName.pushgateway" . }}
|
||||
{{- if .Values.pushgateway.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.pushgateway.priorityClassName }}"
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.pushgateway.name }}
|
||||
image: "{{ .Values.pushgateway.image.repository }}:{{ .Values.pushgateway.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.pushgateway.image.pullPolicy }}"
|
||||
args:
|
||||
{{- range $key, $value := .Values.pushgateway.extraArgs }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 9091
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
{{- if (index .Values "pushgateway" "extraArgs" "web.route-prefix") }}
|
||||
path: /{{ index .Values "pushgateway" "extraArgs" "web.route-prefix" }}/#/status
|
||||
{{- else }}
|
||||
path: /#/status
|
||||
{{- end }}
|
||||
port: 9091
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 10
|
||||
resources:
|
||||
{{ toYaml .Values.pushgateway.resources | indent 12 }}
|
||||
{{- if .Values.pushgateway.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.pushgateway.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.pushgateway.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.pushgateway.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.pushgateway.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- if and .Values.pushgateway.enabled .Values.pushgateway.ingress.enabled -}}
|
||||
{{- $releaseName := .Release.Name -}}
|
||||
{{- $serviceName := include "prometheus.pushgateway.fullname" . }}
|
||||
{{- $servicePort := .Values.pushgateway.service.servicePort -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.pushgateway.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.pushgateway.ingress.annotations | indent 4}}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.pushgateway.fullname" . }}
|
||||
spec:
|
||||
rules:
|
||||
{{- range .Values.pushgateway.ingress.hosts }}
|
||||
{{- $url := splitList "/" . }}
|
||||
- host: {{ first $url }}
|
||||
http:
|
||||
paths:
|
||||
- path: /{{ rest $url | join "/" }}
|
||||
backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end -}}
|
||||
{{- if .Values.pushgateway.ingress.tls }}
|
||||
tls:
|
||||
{{ toYaml .Values.pushgateway.ingress.tls | indent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- if .Values.pushgateway.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.pushgateway.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.pushgateway.service.annotations | indent 4}}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.pushgateway.service.labels }}
|
||||
{{ toYaml .Values.pushgateway.service.labels | indent 4}}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.pushgateway.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.pushgateway.service.clusterIP }}
|
||||
clusterIP: {{ .Values.pushgateway.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.pushgateway.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.pushgateway.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.pushgateway.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.pushgateway.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.pushgateway.service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: 9091
|
||||
selector:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
type: "{{ .Values.pushgateway.service.type }}"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccounts.pushgateway.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.pushgateway.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.serviceAccountName.pushgateway" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,45 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
- nodes/proxy
|
||||
- services
|
||||
- endpoints
|
||||
- pods
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- "extensions"
|
||||
resources:
|
||||
- ingresses/status
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- nonResourceURLs:
|
||||
- "/metrics"
|
||||
verbs:
|
||||
- get
|
||||
{{- end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "prometheus.serviceAccountName.server" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
{{- end }}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
{{- if (empty .Values.server.configMapOverrideName) -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
data:
|
||||
{{- $root := . -}}
|
||||
{{- range $key, $value := .Values.serverFiles }}
|
||||
{{ $key }}: |
|
||||
{{- if eq $key "prometheus.yml" }}
|
||||
global:
|
||||
{{ $root.Values.server.global | toYaml | indent 6 }}
|
||||
{{- end }}
|
||||
{{ toYaml $value | default "{}" | indent 4 }}
|
||||
{{- if eq $key "prometheus.yml" -}}
|
||||
{{- if $root.Values.alertmanager.enabled }}
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- kubernetes_sd_configs:
|
||||
- role: pod
|
||||
tls_config:
|
||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||
{{- if $root.Values.alertmanager.prefixURL }}
|
||||
path_prefix: {{ $root.Values.alertmanager.prefixURL }}
|
||||
{{- end }}
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_namespace]
|
||||
regex: {{ $root.Release.Namespace }}
|
||||
action: keep
|
||||
- source_labels: [__meta_kubernetes_pod_label_app]
|
||||
regex: prometheus
|
||||
action: keep
|
||||
- source_labels: [__meta_kubernetes_pod_label_component]
|
||||
regex: alertmanager
|
||||
action: keep
|
||||
- source_labels: [__meta_kubernetes_pod_container_port_number]
|
||||
regex:
|
||||
action: drop
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- if .Values.server.deploymentAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.server.deploymentAnnotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
spec:
|
||||
replicas: {{ .Values.server.replicaCount }}
|
||||
{{- if .Values.server.strategy }}
|
||||
strategy:
|
||||
{{ toYaml .Values.server.strategy | indent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.server.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.server.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{- if .Values.server.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.server.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.server.priorityClassName }}"
|
||||
{{- end }}
|
||||
{{- if .Values.server.schedulerName }}
|
||||
schedulerName: "{{ .Values.server.schedulerName }}"
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "prometheus.serviceAccountName.server" . }}
|
||||
{{- if .Values.initChownData.enabled }}
|
||||
initContainers:
|
||||
- name: "{{ .Values.initChownData.name }}"
|
||||
image: "{{ .Values.initChownData.image.repository }}:{{ .Values.initChownData.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.initChownData.image.pullPolicy }}"
|
||||
resources:
|
||||
{{ toYaml .Values.initChownData.resources | indent 12 }}
|
||||
# 65534 is the nobody user that prometheus uses.
|
||||
command: ["chown", "-R", "65534:65534", "{{ .Values.server.persistentVolume.mountPath }}"]
|
||||
volumeMounts:
|
||||
- name: storage-volume
|
||||
mountPath: {{ .Values.server.persistentVolume.mountPath }}
|
||||
subPath: "{{ .Values.server.persistentVolume.subPath }}"
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}-{{ .Values.configmapReload.name }}
|
||||
image: "{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}"
|
||||
args:
|
||||
- --volume-dir=/etc/config
|
||||
- --webhook-url=http://127.0.0.1:9090{{ .Values.server.prefixURL }}/-/reload
|
||||
{{- range $key, $value := .Values.configmapReload.extraArgs }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.configmapReload.resources | indent 12 }}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config
|
||||
readOnly: true
|
||||
{{- range .Values.configmapReload.extraConfigmapMounts }}
|
||||
- name: {{ $.Values.configmapReload.name }}-{{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
|
||||
- name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}
|
||||
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
|
||||
args:
|
||||
{{- if .Values.server.retention }}
|
||||
- --storage.tsdb.retention={{ .Values.server.retention }}
|
||||
{{- end }}
|
||||
- --config.file=/etc/config/prometheus.yml
|
||||
- --storage.tsdb.path={{ .Values.server.persistentVolume.mountPath }}
|
||||
- --web.console.libraries=/etc/prometheus/console_libraries
|
||||
- --web.console.templates=/etc/prometheus/consoles
|
||||
- --web.enable-lifecycle
|
||||
{{- range $key, $value := .Values.server.extraArgs }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.baseURL }}
|
||||
- --web.external-url={{ .Values.server.baseURL }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.enableAdminApi }}
|
||||
- --web.enable-admin-api
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.server.prefixURL }}/-/ready
|
||||
port: 9090
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 30
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.server.prefixURL }}/-/healthy
|
||||
port: 9090
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 30
|
||||
resources:
|
||||
{{ toYaml .Values.server.resources | indent 12 }}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config
|
||||
- name: storage-volume
|
||||
mountPath: {{ .Values.server.persistentVolume.mountPath }}
|
||||
subPath: "{{ .Values.server.persistentVolume.subPath }}"
|
||||
{{- range .Values.server.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- range .Values.server.extraConfigmapMounts }}
|
||||
- name: {{ $.Values.server.name }}-{{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- range .Values.server.extraSecretMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.server.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.server.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.server.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.server.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: {{ if .Values.server.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.server.configMapOverrideName }}{{- else }}{{ template "prometheus.server.fullname" . }}{{- end }}
|
||||
- name: storage-volume
|
||||
{{- if .Values.server.persistentVolume.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ if .Values.server.persistentVolume.existingClaim }}{{ .Values.server.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.server.fullname" . }}{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end -}}
|
||||
{{- range .Values.server.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
{{- end }}
|
||||
{{- range .Values.configmapReload.extraConfigmapMounts }}
|
||||
- name: {{ $.Values.configmapReload.name }}-{{ .name }}
|
||||
configMap:
|
||||
name: {{ .configMap }}
|
||||
{{- end }}
|
||||
{{- range .Values.server.extraConfigmapMounts }}
|
||||
- name: {{ $.Values.server.name }}-{{ .name }}
|
||||
configMap:
|
||||
name: {{ .configMap }}
|
||||
{{- end }}
|
||||
{{- range .Values.server.extraSecretMounts }}
|
||||
- name: {{ .name }}
|
||||
secret:
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- range .Values.configmapReload.extraConfigmapMounts }}
|
||||
- name: {{ .name }}
|
||||
configMap:
|
||||
name: {{ .configMap }}
|
||||
{{- end }}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
{{- if .Values.server.ingress.enabled -}}
|
||||
{{- $releaseName := .Release.Name -}}
|
||||
{{- $serviceName := include "prometheus.server.fullname" . }}
|
||||
{{- $servicePort := .Values.server.service.servicePort -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.server.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.server.ingress.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- range $key, $value := .Values.server.ingress.extraLabels }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
spec:
|
||||
rules:
|
||||
{{- range .Values.server.ingress.hosts }}
|
||||
{{- $url := splitList "/" . }}
|
||||
- host: {{ first $url }}
|
||||
http:
|
||||
paths:
|
||||
- path: /{{ rest $url | join "/" }}
|
||||
backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end -}}
|
||||
{{- if .Values.server.ingress.tls }}
|
||||
tls:
|
||||
{{ toYaml .Values.server.ingress.tls | indent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
apiVersion: {{ template "prometheus.networkPolicy.apiVersion" . }}
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
ingress:
|
||||
- ports:
|
||||
- port: 9090
|
||||
{{- end }}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
{{- if .Values.server.persistentVolume.enabled -}}
|
||||
{{- if not .Values.server.persistentVolume.existingClaim -}}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
{{- if .Values.server.persistentVolume.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.server.persistentVolume.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{ toYaml .Values.server.persistentVolume.accessModes | indent 4 }}
|
||||
{{- if .Values.server.persistentVolume.storageClass }}
|
||||
{{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: "{{ .Values.server.persistentVolume.size }}"
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.server.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.server.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.server.service.labels }}
|
||||
{{ toYaml .Values.server.service.labels | indent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "prometheus.server.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.server.service.clusterIP }}
|
||||
clusterIP: {{ .Values.server.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.server.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.server.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.server.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.server.service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: 9090
|
||||
{{- if .Values.server.service.nodePort }}
|
||||
nodePort: {{ .Values.server.service.nodePort }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
type: "{{ .Values.server.service.type }}"
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccounts.server.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "prometheus.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: "{{ .Values.server.name }}"
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "prometheus.serviceAccountName.server" . }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user