Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loki charts #39

Closed
wants to merge 237 commits into from
Closed

Conversation

torstenwalter
Copy link
Collaborator

@torstenwalter torstenwalter commented Oct 3, 2020

This adds the charts from the loki repository (fluent-bit, loki, loki-stack and promtail) to this repo.

It includes the existing history. You can verify it yourself by checking the history for individual files as in the example:

$ git log --oneline charts/loki/Chart.yaml
47ae03c7 bump chart versions and align READMEs
6c3d8033 Add support for PV selector in Loki statefulset (#2554)
03b944e6 updating images to 1.6.0 (#2504)
da9a22dc Add projected and downwardAPI volume types to PodSecurityPolicy (#2355) (#2366)
ca6f2e0d helm: add annotations to service monitor (#2258)
2379cab3 helm: Add loadBalancerIP option to loki chart (#2238)
d837f94d BUG: add missing namespace in ingress object (#2205)
e864f1e4 updating all the images to 1.5.0 release (#2100)
c042b22e helm chart: add missing line feed (#1967)
2f22bdb2 Reverting helm changes which were included in Cortex 1.0 vendor upgrade because it resulted in us pushing an unstable helm.
dfc0778d bumps helm to keepalive-master after cortex vendoring (#1937)
79234cb1 updating helm and ksonnet to 1.4.1 updating Fluent Bit to correct image
b53037c7 updating helm and ksonnet for 1.4.0 release
4b496db7 Move default port for Loki to 3100 everywhere. (#1838)
2d22ae09 Prevent prometheus to scrap both services (#1817)
b2c1287c Added support for imagePullSecrets in Loki Helm chart (#1632)
0b5c3de9 [loki helm chart] added ingress (#1585)
2faa3775 helm: Allow setting 'loadBalancerSourceRanges' for the loki service (#1553)
43ca2e13 updating to 1.3.0 release
d367078a helm: support adding init containers to the loki pod (#1336)
53c4f6cb v1.2.0: update helm and ksonnet (#1389)
3563f1c0 Updating version numbers for 1.1.0 release
fa5e81d4 Update loki helm chart to support service account annotations (#1341)
7a639abf updating helm and ksonnet to version v1.0.0 (#1292)
1b9171d9 helm: update default terminationGracePeriodSeconds to 4800 (#1257)
727fdee8 Helm path update (#1061)
c776952f update versions to new release
92f3a942 Helm: Fix the reference error of loki/loki helm chart (#1056)
7173bcd2 helm: Add support for passing arbitrary secrets (#1111)
7fe67cfe Feature: Add extra containers to loki helm chart (#909)
fce1d990 Helm: Remove default value of storageClassName in loki/loki helm chart (#1058)
6e47577f Bump chart versions
b40eb435 bump chart
4fca8ec6 update  helm and ksonnet to 0.3.0
61c077fe release: update ksonnet and helm charts to version v0.2.0
5a9c666c Helm chart: Added service monitor (#824)
424f36ed Helm: Be able to customize the Namespace (#830)
81c54b79 updating versions for loki v0.1.0
264884a5 fix labels for PodDisruptionBudget on helm (#623)
d5e22518 Limits: Reject entries based on age set in limits (#631)
5db6cfd4 Switch Loki to StatefulSet (#585)
8c0383d2 Helm chart tracing variable fix (#621)
d535827f ksonnet changes for running loki in single binary (#622)
481929f6 Added namespace to helm install notes (#617)
19c4d3f4 need to bump helm chart after PR #598
1b0d55be Limiting query start time with config (#572)
09d633b0 add optional PodDisruptionBudget to helm chart (#515)
f56cb644 Add option (#528)
d8c0feb0 Enable tracing loki in helm chart (#496)
2229932b Helm: Allow custom loki config
e5ed45af Separate loki & promtail charts
513388ad Setup Helm chart repository

These are the command, which have been used to migrate the history:

# Prepare loki repository for merge
git clone git@github.com:grafana/loki.git /tmp/loki
cd /tmp/loki
# Filter history for helm charts to reduce repository size
git filter-repo --path-glob 'production/helm/*' --path-rename production/helm/:charts/

# Merge history into helm-charts repository
git clone git@github.com:grafana/helm-charts.git /tmp/grafana-helm-charts
cd /tmp/grafana-helm-charts
git checkout -b merge-loki-charts
git remote add -f loki /tmp/loki/.git
git merge --allow-unrelated-histories -s ours --no-commit loki/master
git read-tree --prefix=charts/fluent-bit -u loki/master:charts/fluent-bit
git read-tree --prefix=charts/loki -u loki/master:charts/loki/
git read-tree --prefix=charts/loki-stack -u loki/master:charts/loki-stack/
git read-tree --prefix=charts/promtail -u loki/master:charts/promtail
git commit -s -S -m "Added fluent-bit, loki, loki-stack and promtail charts"

Filtering the history was did a great trick on reducing the history size.

In addition to migrating the repositories the following things have been done:

  • all linting errors in Markdown files have been resolved
  • minor version of all charts have been increased
    The goal of this is to publish a newer version of the charts from this repo. I choose to increase the minor version so that it's possible to increase the patch version to deprecate the existing charts and point to the new location.
  • all READMEs have been adjusted to take the new helm repository location into account.

Note:

  • grafana, prometheus and logstash dependencies of loki-stack still point to https://kubernetes-charts.storage.googleapis.com/
    This should be fixed after this is merged.
  • I disabled validation of maintainers as "Loki Maintainers" is not a valid GitHub username.
    Here one should decide if one explicitly want's to name all maintainers or refer to a github team which exists.
    Not sure if GitHub teams could be resolved, but we could at least use it in CODEOWNERS file.
  • DCO check is failing as history was imported. We should ignore it for this PR.

Part-of: grafana/loki#2593

tomwilkie and others added 30 commits April 15, 2018 14:31
* 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>
Signed-off-by: Xiang Dai <764524258@qq.com>
Signed-off-by: Xiang Dai <764524258@qq.com>
* allow promtail target path to be a glob match

Promtail now expects __path__ to be a glob. All files that match
the glob expression will be tailed.  If new files are created that
match the glob, they will immediately be tailed.

* remove entry from positions file when file is deleted

* fix syncing the current positions to positions file

* handle file renames

When a file is renamed a "rename" and a "create" event are sent.
We need to treat the rename as a remove.  If the new filename matches
the path glob, then we will start tailing it when the "create" event
is reveived.

* lint
fixes grafana#190
Pods can have multiple containers. This fix ensures that we collect
logs for all containers.
add container_name label to logs
…me/ for the helm chart too.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Update cortex to include optionally-enforce-metric-name

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Configure validation to allow 'metrics' without metric names.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Flush idle chunks properly

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Review feedback

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Review feedback.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Check the correct chunk is full before appending a new chunk.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Add the config to helm and ksonnet too.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
kubelet creates a new log file when a container is restarted.
So we need to catpure all log files in the
`/var/logs/pods/<uid>/<container_name>/` dir.
dont add pods twice if they have app and name labels
* update helm values yaml

- set persistence.enabled as 'false' as default since there is no pv as
default

- set persistence.storageClassName as 'default' since even if pv exists, pvc
still need storageClassName:

```
  Normal  FailedBinding  8s (x4 over 35s)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
```

Signed-off-by: Xiang Dai <764524258@qq.com>

* helm: delete duplicate empty blank

Signed-off-by: Xiang Dai <764524258@qq.com>
Loki pod needs secret mounting privileges
- Loki and promtail are under heavy development, always pulling makes sure bug fixes are shipped
Change image pull default policy to Always
…adiness proble for loki and example antiaffinity.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
@owen-d
Copy link
Member

owen-d commented Oct 12, 2020

Thanks for the writeup; this looks great. I think it's reasonable to have a followup PR to change the repository references as you've suggested @torstenwalter. This also seems sensible for @scottrigby's logstash comments.

Anything else y'all see that needs to be done? I'd like to merge this soon and start updates on the loki side referencing it :)

/cc @cyriltovena @slim-bean

@torstenwalter torstenwalter marked this pull request as ready for review October 12, 2020 14:03
@torstenwalter
Copy link
Collaborator Author

@owen-d Whom from Grafana side would need to approve the PR?
Which people should be granted write permissions to this repository? Is it possible to come up with an initial list of people which we could add as maintainers and also add to CODEOWNERS?

@unguiculus
Copy link
Collaborator

unguiculus commented Oct 19, 2020

Note that charts in the Loki charts repo are signed. This needs to be taken care of here as well.

@torstenwalter
Copy link
Collaborator Author

Note that charts in the Loki charts repo are signed. This needs to be taken care of here as well.

Do you know how to do it with chart releaser GitHub action?

@unguiculus
Copy link
Collaborator

I just checked. It currently can't be done with the GitHub action. chart-releaser itself supports signed charts for index and release creation. Meanwhile, chart-releaser also has support for packaging (without signing). But that's not used by the action yet. So, there's a few things left to do. I'll try and look into it.

@unguiculus
Copy link
Collaborator

Support for GPG singing in chart-releaser is on its way now: helm/chart-releaser#81

{{ template "loki.fullname" . }}-alerting-rules.yaml: |-
groups:
{{- toYaml .Values.alerting_groups | nindent 6 }}
{{- end }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe extra empty line here.

@torstenwalter torstenwalter marked this pull request as draft November 26, 2020 18:51
@torstenwalter
Copy link
Collaborator Author

I needed to do a force push to be able to include latest commits from loki repository. Will try to fix the build issues in the next days.

zanhsieh
zanhsieh previously approved these changes Nov 26, 2020
@cyriltovena
Copy link
Contributor

@scottrigby @torstenwalter @unguiculus

Thank you for all the hard work and the patience !

@cyriltovena
Copy link
Contributor

We should talk about how to finish this during our next community call on thursday, you're all welcome see https://docs.google.com/document/d/1MNjiHQxwFukm2J4NJRWyRgRIiK7VpokYyATzJ5ce-O8/edit

@torstenwalter
Copy link
Collaborator Author

Should we also copy previous releases to this repo?

@torstenwalter
Copy link
Collaborator Author

We should talk about how to finish this during our next community call on thursday, you're all welcome see https://docs.google.com/document/d/1MNjiHQxwFukm2J4NJRWyRgRIiK7VpokYyATzJ5ce-O8/edit

I am sorry I can't join this week due to work related stuff.

@unguiculus
Copy link
Collaborator

@cyriltovena I'm planning to join.

unguiculus added a commit to unguiculus/grafana-helm-charts that referenced this pull request Dec 9, 2020
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
@torstenwalter
Copy link
Collaborator Author

This is superseded by #112 #113 #114 and #120

@torstenwalter torstenwalter deleted the merge-loki-charts branch December 10, 2020 00:25
unguiculus added a commit to unguiculus/grafana-helm-charts that referenced this pull request Dec 10, 2020
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.