Davlet Panech bce548b9bc stx: login to Dockerhub within k8s
Docker hub sometimes refuses to serve requests due to rate limits on
anonymous pulls. We already support an option to login to Docker hub
before pulling or building environment containers. However, this has no
effect for images pulled by k8s itself, via a helm chart reference, eg
for the nginx container.

This patch adds a similar option: "stx start --use-dockerhub-cred":
* creates a k8s secret with Docker hub credentials extracted from the
  calling user's $HOME/.docker/config.json
* inserts this secret into the helm chart when starting

This option is now used when "stx-init-env" is called with the
"--dockerhub-login" option.

TESTS
=======================
* Use "stx control start --use-dockerhub-cred" and inspect the installed
  helm release to make sure the secret has been created and passed on to
  the chart
* Using a slightly modified chart that refers to a private image, not
  accessible to anonymous users:
  - make sure k8s image pull fails without the new option
  - make sure k8s image pull succeeds with the new option
* Delete the profile and re-create the environment with and without the
  login option
* Make sure the secret gets deleted by "stx control stop"
* Use "stx-init-env" with and without "--dockerhub-login" and make sure
  the helm chart is installed correctly

Change-Id: I4c6962ad82e659005b4b7ea840c1ca709c05c60e
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2025-04-07 11:27:06 -04:00
..
2022-03-04 13:59:05 -05:00