Azure容器部署

编程入门 行业动态 更新时间:2024-10-07 04:22:24
本文介绍了Azure容器部署-“操作失败,状态为200:资源状态失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Azure中,我们尝试使用具有准备好的YAML的Azure容器实例来创建容器.在执行密码容器创建命令的机器上,输入密码后,我们可以成功登录到我们的私有注册表(例如, JFrog Artifactory 上的fa-docker-snapshot-local.dockerp.dev),我们可以码头工人也拉它

From Azure we try to create container using the Azure Container Instances with prepared YAML. From the machine where we execute az container create command we can login successfully to our private registry (e.g fa-docker-snapshot-local.dockerp.dev on JFrog Artifactory ) after entering password and we can docker pull it as well

docker login fa-docker-snapshot-local.dockerp.dev -u svc-faselect Login succeeded

因此我们可以成功拉出它,并且图像路径与手动进行docker pull时相同:

So we can pull it successfully and the image path is the same like when doing manually docker pull:

image: fa-docker-snapshot-local.dockerp.dev/fa/ads:test1

我们有要部署的YAML文件,并尝试使用SAME服务器中的az命令创建容器.在YAML文件中,我们设置了相同的注册表信息:服务器,用户名和密码以及相同的图像

We have YAML file for deploy, and trying to create container using the az command from the SAME server. In the YAML file we have set up the same registry information: server, username and password and the same image

az container create --resource-group FRONT-SELECT-NA2 --file ads-azure.yaml

当我们尝试执行此命令时,它需要30分钟,并且在显示该消息之后:部署失败.操作失败,状态为200:资源状态失败".

When we try to execute this command, it takes for 30 minutes and after that message is displayed: "Deployment failed. Operation failed with status 200: Resource State Failed"

全Yaml:

apiVersion: '2019-12-01' location: eastus2 name: ads-test-group properties: containers: - name: front-arena-ads-test properties: image: fa-docker-snapshot-local.dockerp.dev/fa/ads:test1 environmentVariables: - name: 'DBTYPE' value: 'odbc' command: - /opt/front/arena/sbin/ads_start - ads_start - '-unicode' - '-db_server test01' - '-db_name HEDGE2_ADM_Test1' - '-db_user sqldbadmin' - '-db_password pass' - '-db_client_user HEDGE2_ADM_Test1' - '-db_client_password Password55' ports: - port: 9000 protocol: TCP resources: requests: cpu: 1.0 memoryInGB: 4 volumeMounts: - mountPath: /opt/front/arena/host name: ads-filesharevolume imageRegistryCredentials: # Credentials to pull a private image - server: fa-docker-snapshot-local.dockerp.dev username: svcacct-faselect password: test ipAddress: type: Private ports: - protocol: tcp port: '9000' volumes: - name: ads-filesharevolume azureFile: sharename: azurecontainershare storageAccountName: frontarenastorage storageAccountKey: kdUDK97MEB308N= networkProfile: id: /subscriptions/746feu-1537-1007-b705-0f895fc0f7ea/resourceGroups/SELECT-NA2/providers/Microsoft.Network/networkProfiles/fa-aci-test-networkProfile osType: Linux restartPolicy: Always tags: null type: Microsoft.ContainerInstance/containerGroups

能否请您帮助我们为什么会出现此错误?谢谢

Can you please help us why this error occurs? Thank you

推荐答案

据我所知,您的YAML文件没有问题,我只能给您一些可能的原因.

According to my knowledge, there is nothing wrong with your YAML file, I only can give you some possible reasons.

  • 确保配置正确,服务器URL,用户名和密码,还包括图像名称和标签;
  • 将端口从'9000'更改为 9000'',我的意思是删除双引号;
  • 看看注意,也许装载量使容器崩溃了.然后,您需要将文件共享装载到新文件夹,这意味着以前不存在的新文件夹.
  • Make sure the configurations are all right, the server URL, username, and password, also include the image name and tag;
  • Change the port from '9000' into 9000``, I mean remove the double quotes;
  • Take a look at the Note, maybe the mount volume makes a crash to the container. Then you need to mount the file share to a new folder, I mean the new folder that does not exist before.
  • 更多推荐

    Azure容器部署

    本文发布于:2023-10-10 18:21:17,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1479364.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:容器   Azure

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!