mirror of https://github.com/linkerd/linkerd2.git
197 lines
6.6 KiB
YAML
197 lines
6.6 KiB
YAML
---
|
|
###
|
|
### Grafana
|
|
###
|
|
---
|
|
kind: ConfigMap
|
|
apiVersion: v1
|
|
metadata:
|
|
name: linkerd-grafana-config
|
|
namespace: {{.Values.global.namespace}}
|
|
labels:
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
data:
|
|
grafana.ini: |-
|
|
instance_name = linkerd-grafana
|
|
|
|
[server]
|
|
root_url = %(protocol)s://%(domain)s:/grafana/
|
|
|
|
[auth]
|
|
disable_login_form = true
|
|
|
|
[auth.anonymous]
|
|
enabled = true
|
|
org_role = Editor
|
|
|
|
[auth.basic]
|
|
enabled = false
|
|
|
|
[analytics]
|
|
check_for_updates = false
|
|
|
|
[panels]
|
|
disable_sanitize_html = true
|
|
|
|
datasources.yaml: |-
|
|
apiVersion: 1
|
|
datasources:
|
|
- name: prometheus
|
|
type: prometheus
|
|
access: proxy
|
|
orgId: 1
|
|
{{- if .Values.global.prometheusUrl }}
|
|
url: {{.Values.global.prometheusUrl}}
|
|
{{- else }}
|
|
url: http://linkerd-prometheus.{{.Values.global.namespace}}.svc.{{.Values.global.clusterDomain}}:9090
|
|
{{- end }}
|
|
isDefault: true
|
|
jsonData:
|
|
timeInterval: "5s"
|
|
version: 1
|
|
editable: true
|
|
|
|
dashboards.yaml: |-
|
|
apiVersion: 1
|
|
providers:
|
|
- name: 'default'
|
|
orgId: 1
|
|
folder: ''
|
|
type: file
|
|
disableDeletion: true
|
|
editable: true
|
|
options:
|
|
path: /var/lib/grafana/dashboards
|
|
homeDashboardId: linkerd-top-line
|
|
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: linkerd-grafana
|
|
namespace: {{.Values.global.namespace}}
|
|
labels:
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
ports:
|
|
- name: http
|
|
port: 3000
|
|
targetPort: 3000
|
|
---
|
|
{{- $tree := deepCopy . }}
|
|
{{ $_ := set $tree.Values.global.proxy "workloadKind" "deployment" -}}
|
|
{{ $_ := set $tree.Values.global.proxy "component" "linkerd-grafana" -}}
|
|
{{ include "linkerd.proxy.validation" .Values.global.proxy -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
labels:
|
|
app.kubernetes.io/name: grafana
|
|
app.kubernetes.io/part-of: Linkerd
|
|
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.global.controllerImageVersion}}
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
name: linkerd-grafana
|
|
namespace: {{.Values.global.namespace}}
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 6}}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8 }}
|
|
{{- with .Values.global.podAnnotations }}{{ toYaml . | trim | nindent 8 }}{{- end }}
|
|
labels:
|
|
{{.Values.global.controllerComponentLabel}}: grafana
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{.Values.global.workloadNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 8 }}
|
|
{{- with .Values.global.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }}
|
|
spec:
|
|
{{- if .Values.tolerations -}}
|
|
{{- include "linkerd.tolerations" . | nindent 6 }}
|
|
{{- end -}}
|
|
{{- include "linkerd.node-selector" . | nindent 6 }}
|
|
containers:
|
|
- env:
|
|
- name: GF_PATHS_DATA
|
|
value: /data
|
|
# Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments
|
|
# see https://github.com/grafana/grafana/issues/20096
|
|
- name: GODEBUG
|
|
value: netdns=go
|
|
image: {{.Values.image.name}}:{{ default (default .Values.global.linkerdVersion .Values.global.controllerImageVersion) .Values.image.tag}}
|
|
imagePullPolicy: {{.Values.global.imagePullPolicy}}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3000
|
|
initialDelaySeconds: 30
|
|
name: grafana
|
|
ports:
|
|
- containerPort: 3000
|
|
name: http
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3000
|
|
{{- if .Values.resources -}}
|
|
{{- include "partials.resources" .Values.resources | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
runAsUser: 472
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: data
|
|
- mountPath: /etc/grafana
|
|
name: grafana-config
|
|
readOnly: true
|
|
{{- if not (empty .Values.proxy) }}
|
|
{{- if not (empty .Values.proxy.resources) }}
|
|
{{- $r := merge .Values.proxy.resources .Values.global.proxy.resources }}
|
|
{{- $_ := set $tree.Values.global.proxy "resources" $r }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- include "partials.setControlPlaneTracing.proxy" $tree }}
|
|
- {{- include "partials.proxy" $tree | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ if not .Values.global.cniEnabled -}}
|
|
initContainers:
|
|
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
serviceAccountName: linkerd-grafana
|
|
volumes:
|
|
- emptyDir: {}
|
|
name: data
|
|
- configMap:
|
|
items:
|
|
- key: grafana.ini
|
|
path: grafana.ini
|
|
- key: datasources.yaml
|
|
path: provisioning/datasources/datasources.yaml
|
|
- key: dashboards.yaml
|
|
path: provisioning/dashboards/dashboards.yaml
|
|
name: linkerd-grafana-config
|
|
name: grafana-config
|
|
{{ if .Values.global.controlPlaneTracing -}}
|
|
- {{- include "partials.proxy.volumes.labels" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
{{ if not .Values.global.cniEnabled -}}
|
|
- {{- include "partials.proxyInit.volumes.xtables" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }}
|