forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add loki helm chart Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Add promtail helm chart Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Update loki conf from comment Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Update promtail conf from comment Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Update values from comment Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * adding resources limit and request Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * update README Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * rename to daemonset promtail Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * use masger for loki Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Move into production repo, re-add readme. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com> * Move to production folder Signed-off-by: Julien Garcia Gonzalez <julien@giantswarm.io> * Review feedback; add instructions for installing Grafana with helm. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
- Loading branch information
Showing
21 changed files
with
801 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: loki | ||
version: 0.0.1 | ||
appVersion: 0.0.1 | ||
kubeVersion: "^1.10.0-0" | ||
description: "Loki: like Prometheus, but for logs." | ||
home: https://grafana.com/loki | ||
icon: https://github.com/grafana/loki/raw/master/docs/logo.png | ||
sources: | ||
- https://github.com/grafana/loki | ||
maintainers: | ||
- name: Loki Maintainers | ||
email: lokiproject@googlegroups.com | ||
engine: gotpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Deploy Loki to Kubernetes with Helm | ||
|
||
## Prerequisites | ||
|
||
Make sure you have the helm configure on your cluster: | ||
|
||
```bash | ||
$ helm init | ||
``` | ||
|
||
Clone `grafana/loki` repository and navigate to `production helm` directory: | ||
|
||
```bash | ||
$ git clone https://github.com/grafana/loki.git | ||
$ cd loki/production/helm | ||
``` | ||
|
||
## Deploy Loki and Promtail to your cluster | ||
|
||
```bash | ||
$ helm install . -n loki --namespace <YOUR-NAMESPACE> | ||
``` | ||
|
||
## Deploy Grafana to your cluster | ||
|
||
To install Grafana on your cluster with helm, use the following command: | ||
|
||
```bash | ||
$ helm install stable/grafana -n loki-grafana -f grafana.yaml --namespace <YOUR-NAMESPACE> | ||
``` | ||
|
||
To get the admin password for the Grafana pod, run the following command: | ||
|
||
```bash | ||
$ kubectl get secret --namespace <YOUR-NAMESPACE> loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo | ||
``` | ||
|
||
To access the Grafana UI, run the following command: | ||
|
||
```bash | ||
$ kubectl port-forward --namespace <YOUR-NAMESPACE> service/loki-grafana 3000:80 | ||
``` | ||
|
||
Navigate to http://localhost:3000 and login with `admin` and the password output above. | ||
Then follow the [instructions for adding the loki datasource](/docs/usage.md), using the URL `http://loki:3100/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
image: | ||
tag: master | ||
|
||
env: | ||
GF_EXPLORE_ENABLED: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "loki.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 "loki.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 "loki.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account | ||
*/}} | ||
{{- define "loki.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "loki.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ template "loki.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
data: | ||
loki.yaml: | | ||
auth_enabled: {{ .Values.loki.config.auth_enabled }} | ||
server: | ||
http_listen_port: {{ .Values.loki.service.port }} | ||
ingester: | ||
lifecycler: | ||
ring: | ||
store: {{ .Values.loki.config.ingester.lifecycler.ring.store }} | ||
replication_factor: {{ .Values.loki.config.ingester.lifecycler.ring.replication_factor }} | ||
{{- if .Values.loki.config.schema_configs }} | ||
schema_config: | ||
configs: | ||
{{- range .Values.loki.config.schema_configs }} | ||
- from: {{ .from }} | ||
store: {{ .store }} | ||
object_store: {{ .object_store }} | ||
schema: {{ .schema }} | ||
index: | ||
prefix: {{ .index.prefix }} | ||
period: {{ .index.period }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- if .Values.loki.config.storage_configs }} | ||
storage_config: | ||
{{- range .Values.loki.config.storage_configs }} | ||
{{ .name }}: | ||
directory: {{ .directory }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
apiVersion: apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ template "loki.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- with .Values.loki.annotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ .Values.loki.replicas }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "loki.name" . }} | ||
release: {{ .Release.Name }} | ||
strategy: | ||
type: {{ .Values.loki.deploymentStrategy }} | ||
{{- if ne .Values.loki.deploymentStrategy "RollingUpdate" }} | ||
rollingUpdate: null | ||
{{- end }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
release: {{ .Release.Name }} | ||
{{- with .Values.loki.podAnnotations }} | ||
annotations: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ template "loki.serviceAccountName" . }} | ||
{{- if .Values.loki.priorityClassName }} | ||
priorityClassName: {{ .Values.loki.priorityClassName }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.loki.image.repository }}:{{ .Values.loki.image.tag }}" | ||
imagePullPolicy: {{ .Values.loki.image.pullPolicy }} | ||
args: | ||
- "-config.file=/etc/loki/loki.yaml" | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/loki | ||
ports: | ||
- name: {{ template "loki.name" . }} | ||
containerPort: {{ .Values.loki.service.port }} | ||
protocol: TCP | ||
{{- with .Values.loki.livenessProbe }} | ||
livenessProbe: | ||
{{ toYaml . | indent 12 }} | ||
{{- end }} | ||
{{- with .Values.loki.readinessProbe }} | ||
readinessProbe: | ||
{{ toYaml . | indent 12 }} | ||
{{- end }} | ||
{{- with .Values.loki.resources }} | ||
resources: | ||
{{ toYaml . | indent 12 }} | ||
{{- end }} | ||
{{- with .Values.loki.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.loki.affinity }} | ||
affinity: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.loki.tolerations }} | ||
tolerations: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ template "loki.fullname" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.rbac.pspEnabled }} | ||
apiVersion: extensions/v1beta1 | ||
kind: PodSecurityPolicy | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
privileged: false | ||
allowPrivilegeEscalation: false | ||
volumes: | ||
- 'configMap' | ||
hostNetwork: false | ||
hostIPC: false | ||
hostPID: false | ||
runAsUser: | ||
rule: 'RunAsAny' | ||
seLinux: | ||
rule: 'RunAsAny' | ||
supplementalGroups: | ||
rule: 'RunAsAny' | ||
fsGroup: | ||
rule: 'RunAsAny' | ||
readOnlyRootFilesystem: false | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if .Values.rbac.create }} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
{{- if .Values.rbac.pspEnabled }} | ||
rules: | ||
- apiGroups: ['extensions'] | ||
resources: ['podsecuritypolicies'] | ||
verbs: ['use'] | ||
resourceNames: [{{ template "loki.fullname" . }}] | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ template "loki.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "loki.serviceAccountName" . }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "loki.fullname" . }} | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ template "loki.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- if .Values.loki.service.labels }} | ||
{{ toYaml .Values.loki.service.labels | indent 4 }} | ||
{{- end }} | ||
{{- with .Values.loki.service.annotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
ports: | ||
- name: {{ template "loki.name" . }} | ||
port: {{ .Values.loki.service.port }} | ||
protocol: TCP | ||
targetPort: {{ .Values.loki.service.port }} | ||
selector: | ||
app: {{ template "loki.name" . }} | ||
release: {{ .Release.Name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.serviceAccount.create }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: {{ template "loki.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "loki.serviceAccountName" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "promtail.name" -}} | ||
{{- default .Chart.Name .Values.promtail.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 "promtail.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.promtail.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 "promtail.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account | ||
*/}} | ||
{{- define "promtail.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "promtail.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
Oops, something went wrong.