loki icon indicating copy to clipboard operation
loki copied to clipboard

feat:area/promtail: Added support to install wget on promtail docker image

Open Sheikh-Abubaker opened this issue 1 year ago • 3 comments

What this PR does / why we need it: Users will now be able to make http request on the promtail API to do the healthcheck. Which issue(s) this PR fixes: Fixes #11590

Special notes for your reviewer:

Checklist

  • [x] Reviewed the CONTRIBUTING.md guide (required)
  • [ ] Documentation added
  • [ ] Tests updated
  • [ ] CHANGELOG.md updated
    • [ ] If the change is worth mentioning in the release notes, add add-to-release-notes label
  • [ ] Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • [ ] For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • [ ] If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Sheikh-Abubaker avatar Jan 18 '24 20:01 Sheikh-Abubaker

Can you elaborate on what your end goal is here? It's not entirely clear to me. Promtail already serves all of it's endpoints on an HTTP port.

We also have some users asking for images with even less dependencies, like a scratch image with only our binaries. I think we're more likely to go towards that direction than installing more packages.

cstyan avatar Jan 19 '24 17:01 cstyan

Can you elaborate on what your end goal is here? It's not entirely clear to me. Promtail already serves all of it's endpoints on an HTTP port.

@cstyan As you can see the issue https://github.com/grafana/loki/issues/11590 it says there @efficks wants to enable healthcheck on the grafana/promtail docker image but wget or curl is not installed on the image.

To verify the above I went on to check it on my system and found out wget is not installed in grafana/promtail docker image:

sheikhabubaker@DESKTOP-TFVM3PT:~$ docker pull grafana/promtail
Using default tag: latest
latest: Pulling from grafana/promtail
Digest: sha256:c9f886511f40d2cfce44fcbcf650d632c7c73b98a96ee15f4e72ed52e68e7cdc
Status: Image is up to date for grafana/promtail:latest
docker.io/grafana/promtail:latest

What's Next?
  View a summary of image vulnerabilities and recommendations → docker scout quickview grafana/promtail
sheikhabubaker@DESKTOP-TFVM3PT:~$ docker run -it --rm --name promtail-cont --entrypoint /bin/sh grafana/promtail:latest
# wget --version
/bin/sh: 1: wget: not found
#

To install wget onto the grafana/promtail docker image I appended wget to package installing stage into Dockerfile.

Sheikh-Abubaker avatar Jan 19 '24 17:01 Sheikh-Abubaker

I commented on the related issue, no response from the original issue reporter yet: https://github.com/grafana/loki/issues/11590#issuecomment-1906592368

cstyan avatar Feb 20 '24 00:02 cstyan

@Sheikh-Abubaker okay, we can move forward with adding wget to the image. I'm not sure what's happened with the CLA check, you could try squashing all the commits into one but it might actually just be easiest to create a new branch locally off of main and force push to the branch this PR is open for.

cstyan avatar Apr 19 '24 17:04 cstyan

@cstyan done!!

Sheikh-Abubaker avatar Apr 19 '24 18:04 Sheikh-Abubaker

thanks for your patience @Sheikh-Abubaker

@cstyan you're welcome, thanks for your support too 😀!!

Sheikh-Abubaker avatar Apr 19 '24 18:04 Sheikh-Abubaker