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

Fix minio tokengen race #7985

Closed

Conversation

trevorwhitney
Copy link
Collaborator

@trevorwhitney trevorwhitney commented Dec 20, 2022

What this PR does / why we need it:

Removes MinIO from the loki helm chart. This was meant as a convenience, but there's currently no good way to determine the helm run order of jobs defined by the loki helm chart and those of the subchart. As a result, when using minio, it can often occur that the make buckets job doesn't run before the tokengen, which will cause the whole deployment to fail as the provisioner depends on the admin token generated in the tokengen job.

I think it's reasonable to expect people to bring their own object storage.

Other possible solutions
I'm not sure how helm hook weights work between charts and their dependencies. We may be able to solve this with hook weights, and is worth testing before merging this.

TODO:

  • I need to update the docs to reflect this change.

Special notes for your reviewer:
This is built on #7984 and includes changes from that PR.

Checklist

  • Reviewed the CONTRIBUTING.md guide
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@trevorwhitney trevorwhitney requested a review from a team as a code owner December 20, 2022 23:45
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0.1%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Contributor

@jeschkies jeschkies left a comment

Choose a reason for hiding this comment

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

This is awesome. It's a breaking change though. It should come with 4.0 of the Helm chart.

@@ -1,7 +1,8 @@
.PHONY: loki-distributed down add-repos update-repos prepare build-latest-image

IMAGE_TAG := $(shell ../../../tools/image-tag)
REGISTRY_PORT ?= $(shell k3d registry list -o json | jq -r '.[] | select(.name == "k3d-grafana") | .portMappings."5000/tcp" | .[0].HostPort')
EXISTING_REGISTRY_PORT := $(shell k3d registry list -o json | jq -r '.[] | select(.name == "k3d-grafana") | .portMappings."5000/tcp" | .[0].HostPort')
REGISTRY_PORT ?= $(or $(EXISTING_REGISTRY_PORT),46453)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's been an issue on my side 🙂

@@ -0,0 +1,12 @@
# Empty Helm Cluster

This is a cluster designed for testing out helm charts. It is meant for running `helm install` against. It provides the required dependencies of the helm chart and nothing else (ie. minio is installed by the helm chart). This differs from the other envs that, while also using the helm chart, use `tanka` to deploy those charts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This is a cluster designed for testing out helm charts. It is meant for running `helm install` against. It provides the required dependencies of the helm chart and nothing else (ie. minio is installed by the helm chart). This differs from the other envs that, while also using the helm chart, use `tanka` to deploy those charts.
This is a cluster designed for testing out Helm charts. It is meant for running `helm install` against. It provides the required dependencies of the Helm chart and nothing else (ie. minio is installed by the Helm chart). This differs from the other envs that, while also using the helm chart, use `tanka` to deploy those charts.

},

minioNamespace: k.core.v1.namespace.new('minio'),
minio: helm.template('minio', '../../charts/minio', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have a values file instead? I'd love to document the steps without some automation.

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@trevorwhitney
Copy link
Collaborator Author

Replacing with #8064, which fixes this problem without removing minio

trevorwhitney added a commit that referenced this pull request Jan 11, 2023
…8064)

**What this PR does / why we need it**:

This PR replaces #7985. It solves
the same problem, which is the race condition between the minio create
bucket job and the enterprise tokengen job, but without removing minio.
mraboosk pushed a commit to mraboosk/loki that referenced this pull request Oct 7, 2024
…rafana#8064)

**What this PR does / why we need it**:

This PR replaces grafana#7985. It solves
the same problem, which is the race condition between the minio create
bucket job and the enterprise tokengen job, but without removing minio.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants