Front slash not working in image name for kubernetes, how to use this?

Uday Kiran Reddy (ureddy) 86 Reputation points
2021-12-29T20:07:25.543+00:00

We have an azure container registry where the imagename is in this format.

image: <acr_name>//:

Earlier with only <acr_name>/: it worked.

But with /<branch_name> added, I am getting error as

NAME                           READY   STATUS             RESTARTS   AGE  
frontend-7c96f879c5-45nsx      1/2     InvalidImageName   0          9m5s  

How to use this now in kubernetes environment?

The image is there in the acr.

161272-ssss.png

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
387 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,854 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. shiva patpi 13,131 Reputation points Microsoft Employee
    2021-12-30T06:06:22.56+00:00

    Hello @Uday Kiran Reddy (ureddy) ,
    I just tried with below sample image format in ACR and it went through successfully
    kubectl run httpd --image=acrrepositoryname.azurecr.io/server/httpd:2.4

    161335-image.png

    161276-image.png

    161344-image.png

    Let me know if that helps !

    Regards,
    Shiva.


  2. shiva patpi 13,131 Reputation points Microsoft Employee
    2021-12-30T16:35:02.98+00:00

    For the latest issue in Devops variable , can you try to use lower function to convert the variable value to all lowercase
    https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#lower

    Check out the below articles if that helps:
    https://stackoverflow.com/questions/58268287/how-to-lowercase-azure-devops-pipeline-variables-names

    If the lower function is not working for you , if you are using some dependent variables , try the alternative options mentioned here:
    https://stackoverflow.com/questions/63669006/lower-function-does-not-seem-to-work-in-azure-devops-yaml-pipeline

    Regards,
    Shiva.

    0 comments No comments