Hello Kirsten Rode, Welcome to Microsoft Q&A, Thankyou for posting your query.
Check the logs of the container instance to see if there are any error messages that could indicate the cause of the restarts, You can use the az container logs command to retrieve the logs.
The error message "CPU and 'y.z' GB memory is not available in the location 'example region' at this moment. Please retry with a different resource request or in another location." indicates that the resources specified for the container cannot be allocated due to heavy load in the region. You can try deploying the container instance to a different region or specifying lower CPU and memory settings.
Check the restart policy for the container instance. The YAML file you provided specifies a restart policy of "always", which means that the container will always be restarted after it runs to completion. If you intend to run task-based containers, you may need to change the restart policy to "OnFailure" or "Never".
Verify that the images used in the container instance are correct and can be pulled from the container registry. You can try pulling the images locally to verify that they are available.
Check the resources requested for each container in the container instance. The YAML file you provided specifies CPU and memory requests for each container. If the resources requested are too high, the container instance may not be able to allocate them.
Hope this helps you.