You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
azd version 0.9.0-beta.2 (commit afa7ac6e839be8304b86b3df6b8525a97e48a532)
Describe the bug
When deploying Redis on an AKS cluster and redeploying services through azd cli on the same namespace, the step that verifies if the deployment was made correctly fails, causing the command to interrupt.
# Deploy services again (either through *azd up* or *azd deploy*)
azd deploy [--debug]
...
...
(x) Failed: Deploying service public-api-service
ERROR: failed deploying service 'public-api-service': failing invoking action 'deploy', failed retrieving service endpoints, failed waiting for resource, failed waiting for resource, failed unmarshalling resources JSON, json: cannot unmarshal string into Go struct field Port.items.spec.ports.targetPort of type int
After investigation, it seems that azd expects the json output from the AKS services to have targetPorts assigned to integer values only, whereas through redis deployment, this value is a literal string called redis and the ports are sorted at pod level
To Reproduce
A reproducible setup was created in this repository. Instructions are included in the README file.
Expected behavior
There shouldn't be any error on deployment. Especially because the deployment itself was successful, and the failure is on the verification step.
Environment
Information on your environment:
* Language name and version
* IDE and version: Visual Studio Code 1.78.2
Additional context
Things to notice:
deployment of services works correctly and fails only on the validation step
command fails during JSON parsing when verifying deployment (kubectl -get svc -n <environment_name> -json)
this interrupts the command, thus following services are not deployed
if we get the Redis manifest, make changes to targetPorts, and then deploy with kubectl apply, deployment with azd does not complain anymore.
this issue was found with Redis deployment, but any deployment that does the same with the targetPorts will probably result in the same issue
It's possible to check the JSON file with the following command:
kubectl get service --namespace <namespace> -o json
For all Redis-related services (redis-headless, redis-master, redis-replicas) the value for ports.TargetPort is a literal string. That's the cause of conflict with azd
Output from
azd version
Describe the bug
When deploying Redis on an AKS cluster and redeploying services through azd cli on the same namespace, the step that verifies if the deployment was made correctly fails, causing the command to interrupt.
After investigation, it seems that azd expects the
json
output from the AKS services to have targetPorts assigned to integer values only, whereas through redis deployment, this value is a literal string calledredis
and the ports are sorted at pod levelTo Reproduce
A reproducible setup was created in this repository. Instructions are included in the README file.
Expected behavior
There shouldn't be any error on deployment. Especially because the deployment itself was successful, and the failure is on the verification step.
Environment
Information on your environment:
* Language name and version
* IDE and version: Visual Studio Code 1.78.2
Additional context
Things to notice:
kubectl -get svc -n <environment_name> -json
)kubectl apply
, deployment with azd does not complain anymore.It's possible to check the JSON file with the following command:
For all Redis-related services (redis-headless, redis-master, redis-replicas) the value for ports.TargetPort is a literal string. That's the cause of conflict with
azd
Looking at
azd
source code,targetPort
field is specified as integer:The text was updated successfully, but these errors were encountered: