cyberark / kubernetes-conjur-deploy

Scripts for deploying DAP followers to Kubernetes and OpenShift given an existing DAP master cluster
Apache License 2.0
14 stars 15 forks source link

Image pull backoff in OC4.5 because image url is external when using start.sh #160

Open hughsaunders opened 3 years ago

hughsaunders commented 3 years ago

Summary

When deploying a follower to openshift 4.5 via start.sh, the follower deployment is created referring to the seedfetcher image by it's external url. This causes the follower pod to fail to start as it cannot pull the image for it's first init container.

Detail

The following logic determines if an internal or external url is generated:

    if ! [ -z ${TEST_PLATFORM+x} ] && [[ $TEST_PLATFORM =~ ^openshift4 ]] && [[ "$internal" == "true" ]]; then
      echo "image-registry.openshift-image-registry.svc:5000/$CONJUR_NAMESPACE_NAME/$1:$CONJUR_NAMESPACE_NAME"
    else
      echo "$DOCKER_REGISTRY_PATH/$CONJUR_NAMESPACE_NAME/$1:$CONJUR_NAMESPACE_NAME"
    fi

From: https://github.com/cyberark/kubernetes-conjur-deploy/blob/master/utils.sh#L48

TEST_PLAFORM is only set in test.sh and test.sh is only called from the Jenkinsfile. So when a user's entrypoint is start.sh, an internal url will not be generated.

Workaround

Add the following to bootstrap.env when using openshift 4x

TEST_PLATFORM=openshift4.5
izgeri commented 3 years ago

@hughsaunders the method signature has changed since you filed this, and I think it should now be OPENSHIFT_VERSION that you set, e.g. to '4.5'.

https://github.com/cyberark/kubernetes-conjur-deploy/blob/fbe14df8a20e451ffdebca0d4b73c85df52d2bcc/utils.sh#L48

do you want to put up a PR to add this to boostrap.env?