Commit 417ff966 by gitlawr Committed by Denise

Base Copy

logging 0.1.2 -> 0.1.3 monitoring 0.0.4 -> 0.0.5
parent 3c620ac0
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
apiVersion: v1
description: Rancher logging helm chart to support logging function in rancher
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
name: rancher-logging
version: 0.1.2
appVersion: 1.6.3
home: https://www.fluentd.org/
sources:
- https://www.fluentd.org/
maintainers:
- name: Michelia
email: support@rancher.com
# Rancher Logging
* Installs [Fluentd](https://www.fluentd.org/) and flexvolume log driver to collect container logs in Rancher
## Introduction
This chart bootstraps a [Fluentd](https://www.fluentd.org/) daemonset and a [Log-Aggregator](https://github.com/rancher/log-aggregator) flexvolume on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
It's use for sends logs to log target config in rancher.
## Prerequisites
- Rancher 2.1+
\ No newline at end of file
name: fluentd-tester
version: 0.0.2
appVersion: 1.6.3
home: https://www.fluentd.org/
description: A Fluentd Test Helm chart for validate fluentd config
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- rancher
- logging
sources:
- https://github.com/helm/charts/stable/fluentd-elasticsearch
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "fluentd-tester.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "fluentd-tester.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 chart name and version as used by the chart label.
*/}}
{{- define "fluentd-tester.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "fluentd-tester.version" -}}
{{- $name := include "fluentd-tester.name" . -}}
{{- $version := .Chart.Version | replace "+" "_" -}}
{{- printf "%s-%s" $name $version -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "fluentd-tester.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "fluentd-tester.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- if .Values.rbac.create -}}
kind: ClusterRole
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd-tester.fullname" . }}
labels:
app: {{ template "fluentd-tester.name" . }}
chart: {{ template "fluentd-tester.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups:
- ""
resources:
- "namespaces"
- "pods"
verbs:
- "get"
- "watch"
- "list"
{{- end -}}
\ No newline at end of file
{{- if .Values.rbac.create -}}
kind: ClusterRoleBinding
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd-tester.fullname" . }}
labels:
app: {{ template "fluentd-tester.name" . }}
chart: {{ template "fluentd-tester.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: ServiceAccount
name: {{ template "fluentd-tester.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "fluentd-tester.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end -}}
apiVersion: {{ template "deployment_api_version" . }}
kind: Deployment
metadata:
name: {{ template "fluentd-tester.fullname" . }}
labels:
app: {{ template "fluentd-tester.name" . }}
chart: {{ template "fluentd-tester.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
selector:
matchLabels:
app: {{ template "fluentd-tester.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "fluentd-tester.name" . }}
chart: {{ template "fluentd-tester.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "fluentd-tester.fullname" . }}
containers:
- name: "dry-run"
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.command }}
command: {{ .Values.command }}
{{ end }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
{{- if .Values.service }}
ports:
{{- range $port := .Values.service.ports }}
- name: {{ $port.name }}
containerPort: {{ $port.port }}
{{- if $port.protocol }}
protocol: {{ $port.protocol }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 6 }}
{{- end }}
nodeSelector:
{{- include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "fluentd-tester.fullname" . }}
labels:
app: {{ template "fluentd-tester.name" . }}
chart: {{ template "fluentd-tester.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end -}}
labels: {}
image:
repository: rancher/fluentd
tag: v0.1.17
pullPolicy: IfNotPresent
resources: {}
# limits:
# cpu: 100m
# memory: 500Mi
# requests:
# cpu: 100m
# memory: 200Mi
# env:
command: '["sh", "-c", "tail -f /dev/null"]'
rbac:
create: true
serviceAccount:
create: true
annotations: {}
# updateStrategy:
# type: RollingUpdate
tolerations:
- effect: NoSchedule
operator: Exists
nodeSelector: {}
\ No newline at end of file
name: fluentd
version: 0.0.2
appVersion: 1.6.3
home: https://www.fluentd.org/
description: A Fluentd Helm chart for Rancher system logging
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- rancher
- logging
sources:
- https://github.com/helm/charts/stable/fluentd-elasticsearch
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
name: fluentd-linux
version: 0.0.2
appVersion: 1.6.3
home: https://www.fluentd.org/
description: A Fluentd Helm chart for Rancher system logging
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- rancher
- logging
- linux
sources:
- https://github.com/helm/charts/stable/fluentd-elasticsearch
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
apiVersion: {{ template "daemonset_api_version" . }}
kind: DaemonSet
metadata:
name: {{ template "fluentd.fullname" . }}-linux
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
selector:
matchLabels:
app: {{ template "fluentd.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "fluentd.fullname" . }}
containers:
- name: {{ template "fluentd.fullname" . }}
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.command }}
command: {{ .Values.command }}
{{ end }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- mountPath: /fluentd/etc/config/custom
name: custom
- mountPath: /fluentd/etc/config/precan
name: config
- mountPath: /fluentd/etc/config/entry
name: entry
- mountPath: /fluentd/etc/config/ssl
name: ssl
- mountPath: {{ .Values.cluster.dockerRoot }}
name: dockerroot
- mountPath: /var/log/containers
name: varlogcontainers
- mountPath: /var/log/pods
name: varlogpods
- mountPath: /var/lib/rancher/rke/log
name: rkelog
- mountPath: /var/lib/rancher/log-volumes
name: customlog
- mountPath: /fluentd/log
name: fluentdlog
- name: libsystemddir
mountPath: /host/lib
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
ports:
{{- range $port := .Values.service.ports }}
- name: {{ $port.name }}
containerPort: {{ $port.port }}
{{- if $port.protocol }}
protocol: {{ $port.protocol }}
{{- end }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
# Liveness probe is aimed to help in situarions where fluentd
# silently hangs for no apparent reasons until manual restart.
# The idea of this probe is that if fluentd is not queueing or
# flushing chunks for 5 minutes, something is not right. If
# you want to change the fluentd configuration, reducing amount of
# logs fluentd collects, consider changing the threshold or turning
# liveness probe off completely.
livenessProbe:
initialDelaySeconds: 600
periodSeconds: 60
exec:
command:
- '/bin/sh'
- '-c'
- >
LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-300};
STUCK_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-900};
if [ ! -e /fluentd/log/buffer ];
then
exit 1;
fi;
touch -d "${STUCK_THRESHOLD_SECONDS} seconds ago" /tmp/marker-stuck;
if [[ -z "$(find /fluentd/log/buffer -type f -newer /tmp/marker-stuck -print -quit)" ]];
then
rm -rf /fluentd/log/buffer;
exit 1;
fi;
touch -d "${LIVENESS_THRESHOLD_SECONDS} seconds ago" /tmp/marker-liveness;
if [[ -z "$(find /fluentd/log/buffer -type f -newer /tmp/marker-liveness -print -quit)" ]];
then
exit 1;
fi;
{{- end }}
- name: {{ template "fluentd.fullname" . }}-{{ .Values.configmapReload.name }}
image: {{ template "system_default_registry" . }}{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}
imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}"
args:
- --volume-dir=/fluentd/etc/config/custom
- --volume-dir=/fluentd/etc/config/precan
- --volume-dir=/fluentd/etc/config/ssl
- --volume-dir=/fluentd/etc/config/entry
- --webhook-method=GET
- --webhook-url=http://127.0.0.1:24444/api/config.reload
resources:
{{ toYaml .Values.configmapReload.resources | indent 12 }}
volumeMounts:
- mountPath: /fluentd/etc/config/custom
name: custom
- mountPath: /fluentd/etc/config/precan
name: config
- mountPath: /fluentd/etc/config/entry
name: entry
- mountPath: /fluentd/etc/config/ssl
name: ssl
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: /var/lib/rancher/fluentd/etc/config/custom
name: custom
- hostPath:
path: {{ .Values.cluster.dockerRoot }}
name: dockerroot
- hostPath:
path: /var/log/containers
name: varlogcontainers
- hostPath:
path: /var/log/pods
name: varlogpods
- hostPath:
path: /var/lib/rancher/rke/log
name: rkelog
- hostPath:
path: /var/lib/rancher/log-volumes
name: customlog
- hostPath:
path: /var/lib/rancher/fluentd/log
name: fluentdlog
- name: config
secret:
secretName: {{ template "fluentd.fullname" . }}
- name: entry
secret:
secretName: {{ template "fluentd.fullname" . }}-entry
- name: ssl
secret:
secretName: {{ template "fluentd.fullname" . }}-ssl
- name: libsystemddir
hostPath:
path: /usr/lib64
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 6 }}
{{- end }}
nodeSelector:
{{- include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}
nameOverride: fluentd
labels: {}
image:
repository: rancher/fluentd
tag: v0.1.17
pullPolicy: IfNotPresent
resources: {}
# limits:
# cpu: 100m
# memory: 500Mi
# requests:
# cpu: 100m
# memory: 200Mi
# env:
command: '["fluentd", "-c", "/fluentd/etc/config/entry/fluent.conf"]'
livenessProbe:
enabled: true
annotations: {}
# updateStrategy:
# type: RollingUpdate
tolerations:
- effect: NoSchedule
operator: Exists
nodeSelector: {}
service:
type: ClusterIP
ports:
- name: metric
port: 24231
targetPort: metric
cluster:
dockerRoot: /var/lib/docker
service:
ports:
- name: metric
port: 24231
targetPort: metric
configmapReload:
name: reloader
image:
repository: rancher/configmap-reload
tag: v0.3.0-rancher2
pullPolicy: IfNotPresent
resources: {}
\ No newline at end of file
name: fluentd-windows
version: 0.0.1
appVersion: 1.6.3
home: https://www.fluentd.org/
description: A Fluentd Helm chart for Rancher system logging
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- rancher
- logging
- windows
sources:
- https://github.com/helm/charts/stable/fluentd-elasticsearch
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
{{- if .Values.enabled -}}
apiVersion: {{ template "daemonset_api_version" . }}
kind: DaemonSet
metadata:
name: {{ template "fluentd.fullname" . }}-windows
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
selector:
matchLabels:
app: {{ template "fluentd.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "fluentd.fullname" . }}
initContainers:
- name: init-{{ template "fluentd.fullname" . }}
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
command:
- 'powershell'
- '-command'
- 'New-Item -ItemType Directory -Force -Path /var/lib/rancher/fluentd/log'
volumeMounts:
- mountPath: /var/lib/rancher
name: rancher
containers:
- name: {{ template "fluentd.fullname" . }}
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.command }}
command: {{ .Values.command }}
{{ end }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- mountPath: /fluentd/etc/config/precan
name: config
- mountPath: /fluentd/etc/config/entry
name: entry
- mountPath: /fluentd/etc/config/ssl
name: ssl
- mountPath: {{ .Values.cluster.dockerRoot }}
name: dockerroot
- mountPath: /var/log/containers
name: varlogcontainers
- mountPath: /var/log/pods
name: varlogpods
- mountPath: /var/lib/rancher/rke/log
name: rkelog
- mountPath: /fluentd/log
name: fluentdlog
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
ports:
{{- range $port := .Values.service.ports }}
- name: {{ $port.name }}
containerPort: {{ $port.port }}
{{- if $port.protocol }}
protocol: {{ $port.protocol }}
{{- end }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
# use metrics endpoint to monitor liveness
livenessProbe:
httpGet:
path: /metrics
port: 24231
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 60
timeoutSeconds: 3
failureThreshold: 3
successThreshold: 1
{{- end }}
- name: {{ template "fluentd.fullname" . }}-{{ .Values.configmapReload.name }}
image: {{ template "system_default_registry" . }}{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}
imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}"
args:
- --volume-dir=/fluentd/etc/config/precan
- --volume-dir=/fluentd/etc/config/ssl
- --volume-dir=/fluentd/etc/config/entry
- --webhook-method=GET
- --webhook-url=http://127.0.0.1:24444/api/config.reload
resources:
{{ toYaml .Values.configmapReload.resources | indent 12 }}
volumeMounts:
- mountPath: /fluentd/etc/config/precan
name: config
- mountPath: /fluentd/etc/config/entry
name: entry
- mountPath: /fluentd/etc/config/ssl
name: ssl
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: {{ .Values.cluster.dockerRoot }}
name: dockerroot
- hostPath:
path: /var/log/containers
name: varlogcontainers
- hostPath:
path: /var/log/pods
name: varlogpods
- hostPath:
path: /var/lib/rancher/rke/log
name: rkelog
- hostPath:
path: /var/lib/rancher/fluentd/log
name: fluentdlog
- hostPath:
path: /var/lib/rancher
name: rancher
- name: config
secret:
secretName: {{ template "fluentd.fullname" . }}
- name: entry
secret:
secretName: {{ template "fluentd.fullname" . }}-entry
- name: ssl
secret:
secretName: {{ template "fluentd.fullname" . }}-ssl
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 6 }}
{{- end }}
nodeSelector:
{{- include "windows-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}
{{- end }}
nameOverride: fluentd
labels: {}
image:
os: windows
repository: rancher/fluentd
tag: v0.1.17
pullPolicy: IfNotPresent
resources: {}
# limits:
# cpu: 100m
# memory: 500Mi
# requests:
# cpu: 100m
# memory: 200Mi
# env:
command: '["powershell", "-command", "fluentd", "-c", "/fluentd/etc/config/entry/fluent.conf"]'
livenessProbe:
enabled: true
annotations: {}
# updateStrategy:
# type: RollingUpdate
tolerations:
- effect: NoSchedule
operator: Exists
nodeSelector: {}
cluster:
dockerRoot: C:\ProgramData\docker
service:
ports:
- name: metric
port: 24231
targetPort: metric
configmapReload:
name: reloader
image:
os: windows
repository: rancher/configmap-reload
tag: v0.3.0-rancher2
pullPolicy: IfNotPresent
resources: {}
\ No newline at end of file
dependencies:
- name: fluentd-linux
version: 0.0.2
condition: fluentd.fluentd-linux.enabled
repository: "file://./charts/fluentd-linux"
- name: fluentd-windows
version: 0.0.1
condition: fluentd.fluentd-windows.enabled
repository: "file://./charts/fluentd-windows"
\ No newline at end of file
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "fluentd.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "fluentd.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 chart name and version as used by the chart label.
*/}}
{{- define "fluentd.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "fluentd.version" -}}
{{- $name := include "fluentd.name" . -}}
{{- $version := .Chart.Version | replace "+" "_" -}}
{{- printf "%s-%s" $name $version -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "fluentd.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "fluentd.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- if .Values.rbac.create -}}
kind: ClusterRole
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd.fullname" . }}
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups:
- ""
resources:
- "namespaces"
- "pods"
verbs:
- "get"
- "watch"
- "list"
---
kind: ClusterRoleBinding
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd.fullname" . }}
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: ServiceAccount
name: {{ template "fluentd.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "fluentd.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- if .Values.global.podSecurityPolicy.enabled }}
---
kind: Role
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd.fullname" . }}-psp-role
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups:
- "policy"
resources:
- "podsecuritypolicies"
resourceNames:
- {{ .Release.Name }}-psp
verbs:
- "use"
---
kind: RoleBinding
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "fluentd.fullname" . }}-psp-rolebinding
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: ServiceAccount
name: {{ template "fluentd.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ template "fluentd.fullname" . }}-psp-role
apiGroup: rbac.authorization.k8s.io
{{- end -}}
{{- end -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fluentd.fullname" . }}
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
{{- range $key, $value := .Values.secrets.config }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fluentd.fullname" . }}-entry
labels:
app: {{ template "fluentd.name" . }}-entry
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
kubernetes.io/cluster-service: "true"
type: Opaque
data:
{{- range $key, $value := .Values.secrets.entry }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fluentd.fullname" . }}-ssl
labels:
app: {{ template "fluentd.name" . }}-ssl
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
kubernetes.io/cluster-service: "true"
type: Opaque
\ No newline at end of file
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "fluentd.fullname" . }}
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end -}}
{{- if .Values.service }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "fluentd.fullname" . }}
labels:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
{{- range $port := .Values.service.ports }}
- name: {{ $port.name }}
port: {{ $port.port }}
targetPort: {{ $port.port }}
{{- if $port.nodePort }}
nodePort: {{ $port.nodePort }}
{{- end }}
{{- if $port.protocol }}
protocol: {{ $port.protocol }}
{{- end }}
{{- end }}
selector:
app: {{ template "fluentd.name" . }}
chart: {{ template "fluentd.version" . }}
{{- end }}
name: log-aggregator
version: 0.0.2
appVersion: 0.1.4
home: https://github.com/rancher/log-aggregator
description: Deploy flexvolume driver log-aggregator to collect log.
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- flexvolume driver
- logging
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
name: log-aggregator-linux
version: 0.0.1
appVersion: 0.1.4
home: https://github.com/rancher/log-aggregator
description: Deploy flexvolume driver log-aggregator to collect log.
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- flexvolume driver
- logging
- linux
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
apiVersion: {{ template "daemonset_api_version" . }}
kind: DaemonSet
metadata:
name: {{ template "log-aggregator.fullname" . }}-linux
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
selector:
matchLabels:
app: {{ template "log-aggregator.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: {{ template "log-aggregator.fullname" . }}
containers:
- name: log-aggregator
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
volumeMounts:
- name: flexvolume-driver
mountPath: /flexmnt
{{- if .Values.env }}
env:
{{ toYaml .Values.env | indent 10 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
terminationGracePeriodSeconds: 10
nodeSelector:
{{- include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations:
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
volumes:
- name: flexvolume-driver
hostPath:
path: {{ .Values.flexVolumeDir }}
nameOverride: log-aggregator
labels: {}
## Log Aggregator container image
##
image:
repository: rancher/log-aggregator
tag: v0.1.5
nodeSelector: {}
# updateStrategy:
# type: RollingUpdate
tolerations:
- effect: NoSchedule
operator: Exists
## Resource limits & requests
## Ref: https://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
# requests:
# memory: 400Mi
## flexvolume dir
flexVolumeDir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
name: log-aggregator-windows
version: 0.0.1
appVersion: 0.1.4
home: https://github.com/rancher/log-aggregator
description: Deploy flexvolume driver log-aggregator to collect log.
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- flexvolume driver
- logging
- windows
maintainers:
- name: michelia
email: support@rancher.com
engine: gotpl
{{- if .Values.enabled -}}
apiVersion: {{ template "daemonset_api_version" . }}
kind: DaemonSet
metadata:
name: {{ template "log-aggregator.fullname" . }}-windows
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
selector:
matchLabels:
app: {{ template "log-aggregator.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: {{ template "log-aggregator.fullname" . }}
containers:
- name: log-aggregator
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
volumeMounts:
- name: flexvolume-driver
mountPath: /flexmnt
{{- if .Values.env }}
env:
{{ toYaml .Values.env | indent 10 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
terminationGracePeriodSeconds: 10
nodeSelector:
{{- include "windows-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations:
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
volumes:
- name: flexvolume-driver
hostPath:
path: {{ .Values.flexVolumeDir }}
{{- end }}
\ No newline at end of file
nameOverride: log-aggregator
labels: {}
## Log Aggregator container image
##
image:
repository: rancher/log-aggregator
tag: v0.1.5
nodeSelector: {}
# updateStrategy:
# type: RollingUpdate
tolerations:
- effect: NoSchedule
operator: Exists
## Resource limits & requests
## Ref: https://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
# requests:
# memory: 400Mi
## flexvolume dir
flexVolumeDir: C:/var/lib/kubelet/volumeplugins
\ No newline at end of file
dependencies:
- name: log-aggregator-linux
version: 0.0.1
condition: log-aggregator.log-aggregator-linux.enabled
repository: "file://./charts/log-aggregator-linux"
- name: log-aggregator-windows
version: 0.0.1
condition: log-aggregator.log-aggregator-windows.enabled
repository: "file://./charts/log-aggregator-window"
\ No newline at end of file
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "log-aggregator.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "log-aggregator.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 chart name and version as used by the chart label.
*/}}
{{- define "log-aggregator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "log-aggregator.version" -}}
{{- $name := include "log-aggregator.name" . -}}
{{- $version := .Chart.Version | replace "+" "_" -}}
{{- printf "%s-%s" $name $version -}}
{{- end -}}
{{- if .Values.global.podSecurityPolicy.enabled -}}
kind: Role
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "log-aggregator.fullname" . }}-psp-role
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups:
- "policy"
resources:
- "podsecuritypolicies"
resourceNames:
- {{ .Release.Name }}-psp
verbs:
- "use"
---
kind: RoleBinding
apiVersion: {{ template "rbac_api_version" . }}
metadata:
name: {{ template "log-aggregator.fullname" . }}-psp-rolebinding
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: ServiceAccount
name: {{ template "log-aggregator.fullname" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ template "log-aggregator.fullname" . }}-psp-role
apiGroup: rbac.authorization.k8s.io
{{- end -}}
\ No newline at end of file
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "log-aggregator.fullname" . }}
labels:
app: {{ template "log-aggregator.name" . }}
chart: {{ template "log-aggregator.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
log-aggregator-linux:
enabled: true
log-aggregator-windows:
enabled: false
\ No newline at end of file
categories:
- Logging
questions:
dependencies:
- name: fluentd
version: 0.0.2
condition: fluentd.enabled
repository: "file://./charts/fluentd/"
- name: log-aggregator
version: 0.0.2
condition: log-aggregator.enabled
repository: "file://./charts/log-aggregator/"
- name: fluentd-tester
version: 0.0.2
condition: fluentd-tester.enabled
repository: "file://./charts/fluentd-tester/"
\ No newline at end of file
{{/* vim: set filetype=mustache: */}}
{{- define "logging.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "logging.version" -}}
{{- $name := include "logging.name" . -}}
{{- $version := .Chart.Version | replace "+" "_" -}}
{{- printf "%s-%s" $name $version -}}
{{- end -}}
{{- define "deployment_api_version" -}}
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
{{- "apps/v1" -}}
{{- else if .Capabilities.APIVersions.Has "apps/v1beta2" -}}
{{- "apps/v1beta1" -}}
{{- else if .Capabilities.APIVersions.Has "apps/v1beta1" -}}
{{- "apps/v1beta1" -}}
{{- else -}}
{{- "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{- define "daemonset_api_version" -}}
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
{{- "apps/v1" -}}
{{- else if .Capabilities.APIVersions.Has "apps/v1beta2" -}}
{{- "apps/v1beta2" -}}
{{- else -}}
{{- "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{- define "rbac_api_version" -}}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" -}}
{{- "rbac.authorization.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}}
{{- "rbac.authorization.k8s.io/v1beta1" -}}
{{- else -}}
{{- "rbac.authorization.k8s.io/v1alpha1" -}}
{{- end -}}
{{- end -}}
{{- define "system_default_registry" -}}
{{- if .Values.global.systemDefaultRegistry -}}
{{- printf "%s/" .Values.global.systemDefaultRegistry -}}
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
{{- define "linux-node-selector" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
beta.kubernetes.io/os: linux
{{- else -}}
kubernetes.io/os: linux
{{- end -}}
{{- end -}}
{{- define "windows-node-selector" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
beta.kubernetes.io/os: windows
{{- else -}}
kubernetes.io/os: windows
{{- end -}}
{{- end -}}
\ No newline at end of file
{{- if .Values.global.podSecurityPolicy.enabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ .Release.Name }}-psp
labels:
app: {{ template "logging.name" . }}
chart: {{ template "logging.version" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
allowPrivilegeEscalation: false
fsGroup:
ranges:
- max: 65535
min: 1
rule: MustRunAs
requiredDropCapabilities:
- ALL
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
ranges:
- max: 65535
min: 1
rule: MustRunAs
volumes:
- configMap
- emptyDir
- projected
- secret
- downwardAPI
- persistentVolumeClaim
- hostPath
allowedHostPaths:
- pathPrefix: /
{{- end }}
\ No newline at end of file
fluentd:
enabled: false
fluentd-tester:
enabled: false
log-aggregator:
enabled: false
global:
systemDefaultRegistry: ""
podSecurityPolicy:
enabled: true
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
apiVersion: v1
description: Provides monitoring for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: rancher-monitoring
sources:
- https://github.com/coreos/prometheus-operator
version: 0.0.4
appVersion: 0.0.4
home: https://github.com/coreos/prometheus-operator
keywords:
- operator
- prometheus
icon: https://coreos.com/sites/default/files/inline-images/Overview-prometheus_0.png
# rancher-monitoring
Installs [prometheus-operator](https://github.com/coreos/prometheus-operator) to create/configure/manage Prometheus clusters atop Kubernetes.
> **Tip**: Only use for Rancher Monitoring!!!
## Prerequisites
- Rancher 2.2+
apiVersion: v1
description: Creates Alertmanager CRD instance for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: alertmanager
version: 0.0.1
apiVersion: {{ template "operator_api_version" . }}
kind: Alertmanager
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ .Release.Name }}
spec:
{{- if .Values.securityContext }}
securityContext:
{{ toYaml .Values.securityContext | indent 4 }}
{{- end }}
podMetadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
baseImage: {{ template "system_default_registry" . }}{{ .Values.image.repository }}
nodeSelector:
{{- include "linux-node-selector" . | nindent 4 }}
{{- range .Values.nodeSelectors }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
paused: {{ .Values.paused }}
replicas: {{ .Values.replicaCount }}
logLevel: {{ .Values.logLevel }}
{{- if and .Values.resources .Values.resources.core }}
resources:
{{ toYaml .Values.resources.core | indent 4 }}
{{- end }}
retention: "{{ .Values.retention }}"
{{- if .Values.secrets }}
secrets:
{{ toYaml .Values.secrets | indent 4 }}
{{- end }}
{{- if .Values.enabledRBAC }}
serviceAccountName: {{ default (include "app.fullname" .) .Values.serviceAccountName }}
{{- end }}
{{- if or .Values.storageSpec .Values.persistence.enabled }}
storage:
volumeClaimTemplate:
{{- if .Values.persistence.name }}
metadata:
name: {{ .Values.persistence.name }}
{{- end }}
spec:
{{- if .Values.storageSpec }}
{{ toYaml .Values.storageSpec | indent 8 }}
{{- else }}
{{ if and .Values.persistence.storageClass (ne "default" .Values.persistence.storageClass) }}
storageClassName: {{ .Values.persistence.storageClass }}
{{ end }}
accessModes:
- {{ default "ReadWriteOnce" .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
{{- end }}
version: "{{ .Values.image.tag }}"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: {{ template "app.name" . }}
alertmanager: {{ .Release.Name }}
tolerations:
{{- include "linux-node-tolerations" . | nindent 8 }}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 4 }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: expose-alertmanager-metrics
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{ .Values.apiGroup }}: "true"
spec:
type: ClusterIP
clusterIP: None
selector:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
ports:
- name: http
port: 9093
targetPort: web
\ No newline at end of file
{{- if and .Values.enabledRBAC (not .Values.serviceAccountName) }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 2 }}
{{- end }}
\ No newline at end of file
{{- if not .Values.configFromSecret }}
apiVersion: v1
kind: Secret
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
data:
alertmanager.yaml: {{ toYaml .Values.config | b64enc | quote }}
{{- range $key, $val := .Values.templates }}
{{ $key }}: {{ $val | b64enc | quote }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: access-alertmanager
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
kubernetes.io/cluster-service: "true"
spec:
type: ClusterIP
selector:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
ports:
- name: http
port: 80
targetPort: web
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
{{ .Values.apiGroup }}: "true"
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: http
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
enabledRBAC: true
## The name of a secret in the same kubernetes namespace which contains the Alertmanager config
## If defined this will be used instead of the `config` block values.
## The name of the secret must be alertmanager-{{ .Release.Name }} and its data must contain, at least, a key called `alertmanager.yaml`
## that contains the configuration as value.
##
configFromSecret: ""
## Alertmanager template files to include
#
templates: {}
#
# An example template:
# template_1.tmpl: |-
# {{ define "cluster" }}{{ .ExternalURL | reReplaceAll ".*alertmanager\\.(.*)" "$1" }}{{ end }}
#
# {{ define "slack.myorg.text" }}
# {{- $root := . -}}
# {{ range .Alerts }}
# *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
# *Cluster:* {{ template "cluster" $root }}
# *Description:* {{ .Annotations.description }}
# *Graph:* <{{ .GeneratorURL }}|:chart_with_upwards_trend:>
# *Runbook:* <{{ .Annotations.runbook }}|:spiral_note_pad:>
# *Details:*
# {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
# {{ end }}
## Tolerations for use with node taints
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
# - key: "key"
# operator: "Equal"
# value: "value"
# effect: "NoSchedule"
## If true, the Operator won't process any Alertmanager configuration changes
##
paused: false
## Number of Alertmanager replicas desired
##
replicaCount: 1
## How long to retain metrics
##
retention: 24h
## List of Secrets in the same namespace as the Alertmanager
## object, which shall be mounted into the Alertmanager Pods.
## Ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
##
secrets: []
logLevel: "info"
## Alertmanager StorageSpec for persistent data
## Ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec: {}
# storageClassName: gluster
# accessModes: ["ReadWriteOnce"]
# resources:
# requests:
# storage: 50Gi
# selector: {}
apiVersion: v1
description: Creates ServiceMonitor CRD of coredns for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-coredns
version: 0.0.1
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-coredns-metrics
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
name: expose-coredns-metrics
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
targetPort: {{ .Values.ports.metrics.port }}
{{- if not .Values.endpoints }}
selector:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
{{- if not .Values.endpoints }}
- "kube-system"
{{- else }}
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: {{ .Values.ports.metrics.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates Fluentd Metrics Exporter instance for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: aiwantaozi
email: michelia.feng@gmail.com
name: exporter-fluentd
version: 0.0.1
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
- cattle-logging
endpoints:
- port: {{ .Values.ports.metrics.name }}
honorLabels: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates ServiceMonitor CRD of controller manager for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kube-controller-manager
version: 0.0.1
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-kube-cm-metrics
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
name: expose-kube-cm-metrics
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
targetPort: {{ .Values.ports.metrics.port }}
{{- if not .Values.endpoints }}
selector:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- end }}
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
{{- if not .Values.endpoints }}
- "kube-system"
{{- else }}
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: {{ .Values.ports.metrics.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates ServiceMonitor CRD of kube-dns for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kube-dns
version: 0.0.1
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-kube-dns-metrics
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.dnsmasq.name }}
port: {{ .Values.ports.metrics.dnsmasq.port }}
protocol: {{ .Values.ports.metrics.dnsmasq.protocol }}
- name: {{ .Values.ports.metrics.skydns.name }}
port: {{ .Values.ports.metrics.skydns.port }}
protocol: {{ .Values.ports.metrics.skydns.protocol }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
name: expose-kube-dns-metrics
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.dnsmasq.name }}
port: {{ .Values.ports.metrics.dnsmasq.port }}
protocol: {{ .Values.ports.metrics.dnsmasq.protocol }}
targetPort: {{ .Values.ports.metrics.dnsmasq.port }}
- name: {{ .Values.ports.metrics.skydns.name }}
port: {{ .Values.ports.metrics.skydns.port }}
protocol: {{ .Values.ports.metrics.skydns.protocol }}
targetPort: {{ .Values.ports.metrics.skydns.port }}
{{- if not .Values.endpoints }}
selector:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
{{- if not .Values.endpoints }}
- "kube-system"
{{- else }}
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: {{ .Values.ports.metrics.dnsmasq.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.dnsmasq.scheme }}
{{- if eq .Values.ports.metrics.dnsmasq.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: {{ .Values.ports.metrics.skydns.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.skydns.scheme }}
{{- if eq .Values.ports.metrics.skydns.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates ServiceMonitor CRD of etcd for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kube-etcd
version: 0.0.1
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-kube-etcd-metrics
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
name: expose-kube-etcd-metrics
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
targetPort: {{ .Values.ports.metrics.port }}
{{- if not .Values.endpoints }}
selector:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
{{- if not .Values.endpoints }}
- "kube-system"
{{- else }}
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: {{ .Values.ports.metrics.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: {{ .Values.caFile }}
{{- if .Values.certFile }}
certFile: {{ .Values.certFile }}
{{- end }}
{{- if .Values.keyFile }}
keyFile: {{ .Values.keyFile }}
{{- end}}
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates ServiceMonitor CRD of scheduler for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kube-scheduler
version: 0.0.1
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-kube-scheduler-metrics
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
{{- end }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
name: expose-kube-scheduler-metrics
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
targetPort: {{ .Values.ports.metrics.port }}
{{- if not .Values.endpoints }}
selector:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- end }}
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
{{- if not .Values.endpoints }}
- "kube-system"
{{- else }}
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: {{ .Values.ports.metrics.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
apiVersion: v1
description: Creates Kube-state Exporter instance for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kube-state
version: 0.0.1
apiVersion: {{ template "deployment_api_version" . }}
kind: Deployment
metadata:
name: {{ template "app.fullname" . }}
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: kube-state
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
ports:
- name: http
containerPort: 8080
- name: http-metrics
containerPort: 8081
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.enabledRBAC }}
serviceAccountName: {{ default (include "app.fullname" .) .Values.serviceAccountName }}
{{- end }}
{{- if .Values.securityContext }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
tolerations:
{{- include "linux-node-tolerations" . | nindent 8}}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
nodeSelector:
{{- include "linux-node-selector" . | nindent 8 }}
{{- range .Values.nodeSelectors }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
{{- if and .Values.enabledRBAC (not .Values.serviceAccountName) }}
apiVersion: {{ template "rbac_api_version" . }}
kind: ClusterRole
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
rules:
- apiGroups:
- ""
resources:
- namespaces
- nodes
- pods
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- endpoints
- configmaps
- secrets
verbs:
- "list"
- "watch"
- apiGroups:
- "extensions"
- "apps"
resources:
- daemonsets
- deployments
- replicasets
verbs:
- "list"
- "watch"
- apiGroups:
- "apps"
resources:
- statefulsets
- deployments
verbs:
- "list"
- "watch"
- apiGroups:
- "batch"
resources:
- cronjobs
- jobs
verbs:
- "list"
- "watch"
- apiGroups:
- "autoscaling"
resources:
- horizontalpodautoscalers
verbs:
- "list"
- "watch"
- apiGroups:
- "policy"
resources:
- "poddisruptionbudgets"
verbs:
- "list"
- "watch"
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 2 }}
---
apiVersion: {{ template "rbac_api_version" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "app.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "app.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: expose-kubernetes-metrics
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
k8s-app: kube-state
{{ .Values.apiGroup }}: "true"
spec:
type: ClusterIP
clusterIP: None
selector:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
ports:
- name: http
port: 8080
targetPort: http
- name: http-metrics
port: 8081
targetPort: http-metrics
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
{{ .Values.apiGroup }}: "true"
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: http
honorLabels: true
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: http-metrics
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
enabledRBAC: true
## Tolerations for use with node taints
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
# - key: "key"
# operator: "Equal"
# value: "value"
# effect: "NoSchedule"
apiVersion: v1
description: Creates ServiceMonitor CRD of kublets for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kubelets
version: 0.0.1
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "charts.exporter-kubelets.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
{{- if .Values.https }}
- port: https-metrics
scheme: https
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: https-metrics
scheme: https
path: /metrics/cadvisor
honorLabels: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: https-metrics
scheme: https
path: /metrics/resource/v1alpha1
honorLabels: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
metricRelabelings:
- action: replace
regex: (.+)
replacement: $1
sourceLabels:
- container
targetLabel: container_name
- action: replace
regex: (.+)
replacement: $1
sourceLabels:
- pod
targetLabel: pod_name
{{- else }}
- port: http-metrics
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: http-metrics
path: /metrics/cadvisor
honorLabels: true
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
targetLabel: host_ip
action: replace
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
action: replace
regex: (.+)
replacement: $1
- port: http-metrics
path: /metrics/resource/v1alpha1
honorLabels: true
metricRelabelings:
- action: replace
regex: (.+)
replacement: $1
sourceLabels:
- container
targetLabel: container_name
- action: replace
regex: (.+)
replacement: $1
sourceLabels:
- pod
targetLabel: pod_name
{{- end }}
apiVersion: v1
description: Creates ServiceMonitor CRD of apiserver for Kubernetes which maintaining by Rancher 2.
engine: gotpl
maintainers:
- name: thxCode
email: frank@rancher.com
name: exporter-kubernetes
version: 0.0.1
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
{{- range .Values.serviceSelectorLabels }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
namespaceSelector:
matchNames:
- "default"
endpoints:
- port: {{ .Values.ports.metrics.name }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
scheme: {{ .Values.ports.metrics.scheme }}
{{- if eq .Values.ports.metrics.scheme "https" }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
action: replace
targetLabel: host_ip
regex: (.+)
replacement: $1
- sourceLabels:
- __meta_kubernetes_pod_node_name
action: replace
targetLabel: node
regex: (.+)
replacement: $1
apiVersion: v1
description: Windows Node Exporter service/endpoint and service monitor.
engine: gotpl
maintainers:
- name: michelia
email: michelia@rancher.com
name: exporter-node-windows
version: 0.0.1
\ No newline at end of file
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "app.fullname" . }}
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
data:
copy-binary.ps1: |-
$ErrorActionPreference = 'Stop'
function Create-Directory
{
param (
[parameter(Mandatory = $false, ValueFromPipeline = $true)] [string]$Path
)
if (Test-Path -Path $Path) {
if (-not (Test-Path -Path $Path -PathType Container)) {
# clean the same path file
Remove-Item -Recurse -Force -Path $Path -ErrorAction Ignore | Out-Null
}
return
}
New-Item -Force -ItemType Directory -Path $Path | Out-Null
}
function Transfer-File
{
param (
[parameter(Mandatory = $true)] [string]$Src,
[parameter(Mandatory = $true)] [string]$Dst
)
if (Test-Path -PathType leaf -Path $Dst) {
$dstHasher = Get-FileHash -Path $Dst
$srcHasher = Get-FileHash -Path $Src
if ($dstHasher.Hash -eq $srcHasher.Hash) {
return
}
}
$null = Copy-Item -Force -Path $Src -Destination $Dst
}
Create-Directory -Path "c:\host\etc\wmi-exporter"
Transfer-File -Src "c:\etc\wmi-exporter\wmi-exporter.exe" -Dst "c:\host\etc\wmi-exporter\wmi-exporter.exe"
apiVersion: {{ template "daemonset_api_version" . }}
kind: DaemonSet
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
spec:
initContainers:
- name: exporter-node-binary-copy
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
command:
- pwsh
- -f
- c:/scripts/copy-binary.ps1
{{- if and .Values.resources .Values.resources.inits }}
resources:
{{ toYaml .Values.resources.inits | indent 10 }}
{{- end }}
volumeMounts:
- name: binary-host-path
mountPath: c:/host/etc/wmi-exporter
- name: exporter-scripts
mountPath: c:/scripts/
containers:
- name: exporter-node
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
{{- if .Values.args }}
args: {{ .Values.args }}
{{ end }}
ports:
- name: http
containerPort: {{ .Values.ports.metrics.port }}
env:
- name: LISTEN_PORT
value: "{{ .Values.ports.metrics.port }}"
{{- if .Values.enabledCollectors }}
- name: ENABLED_COLLECTORS
value: {{ .Values.enabledCollectors }}
{{- end }}
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 10 }}
{{- end }}
{{- if and .Values.resources .Values.resources.core }}
resources:
{{ toYaml .Values.resources.core | indent 10 }}
{{- end }}
volumeMounts:
- name: wins-pipe
mountPath: \\.\pipe\rancher_wins
{{- if .Values.enabledRBAC }}
serviceAccountName: {{ default (include "app.fullname" .) .Values.serviceAccountName }}
{{- end }}
tolerations:
- operator: Exists
nodeSelector:
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion }}
beta.kubernetes.io/os: windows
{{- else}}
kubernetes.io/os: windows
{{- end}}
{{- range .Values.nodeSelectors }}
{{- $pair := regexSplit "=" . 2 }}
{{- if eq 2 (len $pair) }}
{{ (index $pair 0) }}: {{ (index $pair 1) }}
{{- else }}
{{ (index $pair 0) }}: ""
{{- end }}
{{- end }}
volumes:
- name: wins-pipe
hostPath:
path: \\.\pipe\rancher_wins
- name: binary-host-path
hostPath:
path: c:/etc/wmi-exporter
type: DirectoryOrCreate
- name: exporter-scripts
configMap:
name: {{ template "app.fullname" . }}
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: expose-node-metrics-windows
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
{{- end }}
\ No newline at end of file
{{- if and .Values.enabledRBAC (not .Values.serviceAccountName) }}
apiVersion: {{ template "rbac_api_version" . }}
kind: ClusterRole
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 2 }}
---
apiVersion: {{ template "rbac_api_version" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "app.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "app.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "app.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: expose-node-metrics-windows
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{ .Values.apiGroup }}: "true"
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.ports.metrics.name }}
port: {{ .Values.ports.metrics.port }}
targetPort: {{ .Values.ports.metrics.port }}
protocol: {{ .Values.ports.metrics.protocol }}
apiVersion: {{ template "operator_api_version" . }}
kind: ServiceMonitor
metadata:
labels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
source: rancher-monitoring
name: {{ template "app.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "app.name" . }}
chart: {{ template "app.version" . }}
release: {{ .Release.Name }}
{{ .Values.apiGroup }}: "true"
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: {{ .Values.ports.metrics.name }}
metricRelabelings:
- sourceLabels: [volume, nic]
regex: (.*);(.*)
separator: ''
targetLabel: device
action: replace
replacement: $1$2
- sourceLabels: [__name__]
regex: wmi_cs_logical_processors
replacement: 'system'
targetLabel: mode
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
role: windows-node-recording-rules
source: rancher-monitoring
name: windows-node-recording-rules
namespace: cattle-prometheus
spec:
groups:
- name: windows-cpu-recording.rules
rules:
- record: node_cpu_seconds_total
expr: wmi_cpu_time_total
- record: node_load1
expr: avg_over_time(wmi_system_processor_queue_length[1m])
- record: node_load5
expr: avg_over_time(wmi_system_processor_queue_length[5m])
- record: node_load15
expr: avg_over_time(wmi_system_processor_queue_length[15m])
- record: node_load15
expr: avg_over_time(wmi_system_processor_queue_length[15m])
- name: windows-memory-recording.rules
rules:
- record: node_memory_MemAvailable_bytes
expr: wmi_os_physical_memory_free_bytes
- record: node_memory_MemTotal_bytes
expr: wmi_cs_physical_memory_bytes
- name: windows-network-io-recording.rules
rules:
- record: node_network_receive_bytes_total
expr: wmi_net_bytes_received_total
- record: node_network_transmit_bytes_total
expr: wmi_net_bytes_sent_total
- name: windows-network-packet-recording.rules
rules:
- record: node_network_receive_packets_total
expr: wmi_net_packets_received_total
- record: node_network_transmit_packets_total
expr: wmi_net_packets_sent_total
- record: node_network_receive_drop_total
expr: wmi_net_packets_received_discarded
- record: node_network_receive_errs_total
expr: wmi_net_packets_received_errors
- record: node_network_transmit_drop_total
expr: wmi_net_packets_outbound_discarded
- name: windows-disk-io-recording.rules
rules:
- record: node_disk_written_bytes_total
expr: wmi_logical_disk_write_bytes_total
- record: node_disk_read_bytes_total
expr: wmi_logical_disk_read_bytes_total
- name: windows-file-usage-recording.rules
rules:
- record: node_filesystem_size_bytes
expr: wmi_logical_disk_size_bytes
- record: node_filesystem_free_bytes
expr: wmi_logical_disk_free_bytes
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment