I have cloud server, kubernetes AKS agent and a fl...
# ask-community
j
I have cloud server, kubernetes AKS agent and a flow in Azure storage with a customised container image in azure container registry. When I run the flow it fails on authorisation 401. I have supplied the password to the image in the imagepullsecrets env variable. The error is : Kubernetes Error: rpc error: code = Unknown desc = failed to pull and unpack image "prefregistry.azurecr.io/mstools:v1": failed to resolve reference "prefregistry.azurecr.io/mstools:v1": failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized.
k
Hey @Jai Deo,could you show me about you passed the authentication to the flow/agent? Just remove the sensitive stuff.
j
Hi Kevin - its only test data:-
flow.run_config=KubernetesRun( #image="prefregistry/mstools:v1", image="prefregistry.azurecr.io/mstools:v1", #image="prefecthq/prefect:0.15.3-python3.8", env={"AZURE_STORAGE_CONNECTION_STRING": "DefaultEndpointsProtocol=https;AccountName=prefstorage;AccountKey=uXTpTyGL/9AEoWgOp5TrYRO4x85LyR0dqGttab3eKztv4Qt2PO66zrjfZckgax+bs64QFGFsGGIhsTn8noY61Q==;EndpointSuffix=core.windows.net", "EXTRA_PIP_PACKAGES": "pandas scikit-learn matplotlib"}, labels=["ccc"], image_pull_secrets=["nDGL1hX5MqjCAqNcdBlXqe5BR=69sgYB"], cpu_request=1, memory_request="1Gi" )
k
Can I see your storage also? I’ll figure out the right syntax.
j
flow.storage=Azure(container="ccc", connection_string="DefaultEndpointsProtocol=https;AccountName=prefstorage;AccountKey=uXTpTyGL/9AEoWgOp5TrYRO4x85LyR0dqGttab3eKztv4Qt2PO66zrjfZckgax+bs64QFGFsGGIhsTn8noY61Q==;EndpointSuffix=core.windows.net")
k
So does the build go through but the flow run fails?
j
yes
k
And you see the container in the registry when you check right?
j
yes
k
Ok I’ll try to figure this out
j
Thanks
Hi Kevin, I think the error was at my end - I forgot to give necessary access permissions on the image . I t is working now
k
Oh thanks for mentioning! Amazing you got this all working in a day!