cht-core
cht-core copied to clipboard
CHT deploy script error: upgrade-service image referenced incorrectly
Deploying with latest (master
) cht-script results in incorrectly tagged pod and the service image is incorrect.
Steps to replicate:
-
Check out current master
-
Create values.yaml with this document reference
-
Apply this with
./cht-deploy
script fromcht-core/scripts/deploy
. -
When it completes applying, you get sucessful deployment.
-
Check the status of pods.
upgrade-service
is failed atInvalidImageName
.➜ deploy git:(master) ✗ k -n yuvraj-dev get po NAME READY STATUS RESTARTS AGE cht-api-5f99b5684f-5kl44 1/1 Running 0 9m11s cht-couchdb-ffd46779-hlq72 1/1 Running 0 9m11s cht-haproxy-8f66cb488-5vzkx 1/1 Running 0 9m11s cht-haproxy-healthcheck-7fbc585b9c-bznrx 1/1 Running 0 9m11s cht-sentinel-56f958f5b4-62htm 1/1 Running 0 9m11s upgrade-service-8c894c85c-7jbvl 0/1 InvalidImageName 0 9m11s
-
When you inspect the pod, you get detailed error:
state: waiting: message: 'Failed to apply default image tag "medicmobile/upgrade-service:medicmobile/upgrade-service:0.32": couldn''t parse image reference "medicmobile/upgrade-service:medicmobile/upgrade-service:0.32": invalid reference format' reason: InvalidImageName
-
The reason for this is image is being referenced incorectly.
spec: containers: - env: - name: CHT_NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - name: CHT_DEPLOYMENT_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.labels['cht.service'] - name: UPGRADE_SERVICE_PORT value: "5008" image: medicmobile/upgrade-service:medicmobile/upgrade-service:0.32 imagePullPolicy: IfNotPresent name: upgrade-service
This could possibly be a bug in medic/helm-charts.
The correct image tag for this deployment's container definition should be:
image: medicmobile/upgrade-service:medicmobile/upgrade-service:0.32
I was able to run upgrade-service after I edited deployment and pointed to correct image tag.
This PR fixes it. It will be released today.
@1yuv Can you please verify that this has been resolved?
This is not fixed yet. I ran helm repo update
and applied the changes just as specified here, and the issue is same.
NAME READY STATUS RESTARTS AGE
cht-api-5f99b5684f-4vwx4 1/1 Running 0 11s
cht-couchdb-ffd46779-9n4z6 1/1 Running 0 11s
cht-haproxy-8f66cb488-c6nt8 1/1 Running 0 11s
cht-haproxy-healthcheck-7fbc585b9c-p2869 1/1 Running 0 10s
cht-sentinel-56f958f5b4-9b7ts 1/1 Running 0 10s
upgrade-service-8c894c85c-4d4w8 0/1 InvalidImageName 0 11s
I had to start an instance to check the CHT release quickly and experienced this exact issue today
The fix is in the cht-deploy-fixes
branch @latin-panda. Can you confirm that works for you?
@henokgetachew I can confirm switching to that branch and deploying from there worked.
FYI you can also npx
to deploy now. It's been published to npm
. Meaning you don't have to do it from the repo.
Just run npx @medic/cht-deploy -f <path-from-your-yaml>
I will leave the ticket open until the PR gets merged. I'll leave it assigned to myself until then.