Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

the kubernetes container deployment configuration yaml files have a hardcoded reference to the orod registry #129

Open
kuilboer opened this issue May 6, 2019 · 0 comments

Comments

@kuilboer
Copy link

kuilboer commented May 6, 2019

Error msg form the kubernetes dashboard:

Failed to pull image "registry.ng.bluemix.net/orod/<yaml_file>:": rpc error: code = Unknown desc = failed to resolve image "registry.ng.bluemix.net/orod/code-nginx:latest": failed to fetch anonymous token: unexpected status: 401 Unauthorized

Cause: The following files for their image refer statically to image: "registry.ng.bluemix.net/orod/<imagename>:<label>":

nginx-prd.yaml, nginx-stg.yaml
php-fpm-prd.yaml, phpfpm-stg.yaml
php-cli.yaml

Solution: Update documentation to reflect the fact that the yamls need to be reviewed and the image: line updated to reflect the right registry url and - namespace.

Alternative: Centralize the location for management of the registry url and - namespace
It doesn't seem possible to use environment variables in the yaml files directly this can be solved using the shell command envsubst.

One way to centralize the management of the registry location is to export $REGISTRY_URL and $REGISTRY_NAMESPACE from the pipeline/rolling-code-deploy.sh script.

The yaml files need to be updated so that the image: line reads: image: "$REGISTRY_URL/$REGISTRY_NAMESPACE/<imagename>:<label>"

Using the shell command envsubst you can now substitute the $VARIABLE tags in the yaml files, for the actual value of the environment variable with the same name, before passing the yaml to kubectl for execution. To do this:
The kubectl apply -f statements in the pipeline/rolling-code-deploy.sh script should be changed to:

envsubst < ../kubernetes/<yaml file> | kubectl apply -f -
e.g.:
envsubst < ../kubernetes/php-cli.yaml | kubectl apply -f -

Update the documentation to reflect these changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant