我正在将 MongoDb 部署到 Azure AKS,并使用 Azure 文件共享作为卷(使用持久卷和持久卷声明)。如果我增加副本超过一个,则会发生 CrashLoopBackOff。只有一个 Pod 被创建,其他 Pod 都失败了。
我的 Docker 文件用于创建 MongoDb 映像。
FROM ubuntu:16.04
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
RUN apt-get update && apt-get install -y mongodb-org
EXPOSE 27017
ENTRYPOINT ["/usr/bin/mongod"]
Run Code Online (Sandbox Code Playgroud)
用于部署的 YAML 文件
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: mongo
labels:
name: mongo
spec:
replicas: 3
template:
metadata:
labels:
app: mongo
spec:
containers:
- …Run Code Online (Sandbox Code Playgroud) 我的 Linux 容器没有运行 Web 服务器(它每隔一段时间就会进行后台工作)。它在我的开发盒上完美运行。但是在 Azure 上我出现错误:
错误 - 站点 yyyy 的容器 xxxx 未在预期时间限制内启动。经过的时间 = 230.1049404 秒
我认为这是由 Azure 检查网站是否已启动引起的。我的问题是:是否可以禁用此检查 - 以便我可以在我的容器中运行非网络应用程序?
我只是创建 aks 并创建示例服务。
kubectl get service azure-vote-front --watch
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
azure-vote-front LoadBalancer 10.0.1.71 13.71.XXX.XXX 80:31619/TCP 1h
Run Code Online (Sandbox Code Playgroud)
我想访问 13.71.xxx.xxx:31619 但它正在等待不返回。
我正在关注此文档并尝试使用它在 vm 中运行一个简单的 shell 脚本。
但是post请求的body需要什么内容就不清楚了。commandID 可以是 RunShellScript 但我们在哪里提供脚本值。
我试过这样的身体
{
commandId: "RunShellScript",
script: "/path/scriptname"
}
Run Code Online (Sandbox Code Playgroud)
有其他选择
script: 'scriptname'
script: 'sh scriptname'
Run Code Online (Sandbox Code Playgroud)
和其他每个导致
{
"error": {
"code": "BadRequest",
"message": "Error converting value "/home/admin1/quick-python-test.sh" to type 'System.Collections.Generic.List`1[System.String]'. Path 'script', line 3, position 52.",
"target": "runCommandInput.script"
}
}
Run Code Online (Sandbox Code Playgroud)
谁能帮助我如何正确地做到这一点?我是 Azure 的新手。
无法使用 terraform 在 azure 中为 nsg 安全规则提供目标端口范围。Terraform v0.12.28provider.azurerm v2.18.0
security_rule {
name = "databricks-control-plane-inbound-rule"
priority = 110
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = 225557
}
Run Code Online (Sandbox Code Playgroud)
错误:发送请求失败:StatusCode=400 -- 原始错误:
代码 =“SecurityRuleInvalidPortRange”消息 =“安全规则的端口范围无效。提供的值:225557。值应为整数或带有“-”分隔符的整数范围。有效范围0-65535。” 详情=[]