我得到 Rendering SLS 'base:nginx' failed: 此处不允许映射值;6号线
当我在ansible中运行这段代码时。
parent_dict = [{'nginx-1.13.2.tar.gz':'https://nginx.org/download/nginx-1.13.2.tar.gz'},{'zlib-1.2.11.tar.gz':'https://www.zlib.net/zlib-1.2.11.tar.gz'}]
{% for dict_item in parent_dict %}
{% for key, value in dict_item.items() %}
install-zlib:
cmd.run:
- name: |
cd /tmp
curl -L {{ value }} -o {{ key }}
tar xzf {{ key }}
rm -rf {{ key }}
- creates: /tmp/{{ key }}
{% endfor %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud) 我正在尝试配置一个 docker 文件以在脚本准备好后运行它。
基本上我希望我的微服务能够等到另一个服务可以启动。我正在遵循一本书中的教程,所以我有这个 dockerfile:
FROM openjdk:8-jdk-alpine
RUN apk update && apk upgrade && apk add netcat-openbsd
ARG JAR_FILE
ADD target/${JAR_FILE} /usr/share/theexplorer/theexplorer.jar
ADD run.sh run.sh
RUN chmod +x run.sh
CMD ./run.sh
EXPOSE 8761
Run Code Online (Sandbox Code Playgroud)
我有这个脚本(run.sh):
echo "********************************************************"
echo "Waiting for the configuration server to start on port $CONFIGSERVER_PORT"
echo "********************************************************"
while ! `nc -z configserver $CONFIGSERVER_PORT `; do sleep 3; done
echo ">>>>>>>>>>>> Configuration Server has started"
java -jar /usr/share/theexplorer/theexplorer.jar
Run Code Online (Sandbox Code Playgroud)
但 $CONFIGSERVER_PORT 的值为空。我不知道这个变量应该如何可用,因为我在调用 run.sh 时没有传递任何参数。那么,我应该如何设置$CONFIGSERVER_PORT?有没有什么聪明的方法可以知道我的服务所依赖的服务的端口?
任何帮助表示赞赏!
我正在尝试使用 Cloudformation 在 AWS APIGateway 的方法执行上设置标头映射。
这是我尝试使用的 Cloudformation JSON 模板片段:
"AlertDetailMock": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"RestApiId": {
"Ref": "RestApi"
},
"ResourceId": {
"Ref": "AlertDetailResource"
},
"HttpMethod": "OPTIONS",
"AuthorizationType": "NONE",
"Integration": {
"Type": "MOCK",
"RequestTemplates": {
"application/json": "{\"statusCode\": 200}"
}
},
"IntegrationResponses": [
{
"ResponseTemplates": {
"application/json": ""
},
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": "\\'*\\'",
"method.response.header.Access-Control-Allow-Methods": "\\'GET,OPTIONS\\'",
"method.response.header.Access-Control-Allow-Headers": "\\'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token\\'"
},
"StatusCode": 200
}
],
"MethodResponses": [
{
"ResponseModels": {
"application/json": {
"Ref": "AlertDetailsModel"
}
},
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": true,
"method.response.header.Access-Control-Allow-Methods": true, …
Run Code Online (Sandbox Code Playgroud) json amazon-web-services aws-cloudformation devops aws-api-gateway
我有一个 CloudFormation 堆栈,如下所示,
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"/home/ec2-user/create_db_user.sh" : {
"source" :
"http://s3.amazonaws.com/devops/create_db_user.sh",
"mode" : "000755",
"owner" : "ec2-user"
}
}
...
Run Code Online (Sandbox Code Playgroud)
在我需要将此初始化脚本输出设置为 cloudformation 堆栈之后,我需要在 EC2 实例启动时运行此命令。
我怎么能这样。
amazon-web-services aws-cloudformation devops infrastructure-as-code
我们希望运行一些需要一定功率的构建。
默认构建实例的等效时钟速度是多少?它们有多少个虚拟内核和多少 RAM?它们可以配置为具有更高的规格吗?
我应该在哪里提交 Dockerfile?在项目代码库中还是在 devops 代码库中?
推理细节:
在古代,当开发具有多个代码库的复杂应用程序时,人们通常希望每个项目有一个 repo,并将所有密码、凭据和 dev/test/pre/prod 配置与代码分开。
+-----------------------------------------------------------------------+
| |
| +---------+ +---------+ +---------+ +---------+ |
| | app-1 | | app-2 | | app-3 | | app-4 | |
| +---------+ +---------+ +---------+ +---------+ |
| |
| +----+ |
| | |\ |
| | +-+ |
| | conf | |
| | files| |
| +------+ |
| |
+-----------------------------------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
在古代,一位系统管理员在服务器中安装了该软件,然后复制了配置文件。早在 90 年代,管理员通常将这些文件放在他自己的目录中,仅与老板共享。
后来我们改进了循环:在 Continuos …
在 Azure DevOps 中,我创建了一个 Build。在那个构建中,我创建了一个 ProjectBuildNumber Pipeline 变量,该变量在排队时可设置。然后在选项 -> 内部版本号格式下使用该变量来设置我在 Azure 中显示的内部版本号。
但是,我试图在我正在构建/部署的代码中设置该 ProjectBuildNumber 变量。有没有办法可以在我的 Build 中有一个 Task 来更新该 ProjectBuildNumber 并更新 Azure DevOps 中的 Build 号?
我想在 microsoft/dotnet:latest 映像中安装 donet Framework 4.6.1(.net 核心需要此映像,但我也需要框架)
我是 Kubernetes 的新手,我尝试应用 yaml 文件在 GKE 中创建 Postgres,我收到错误消息“错误:无法启动容器“postgres”:来自守护进程的错误响应:创建挂载源路径时出错'/mnt /data': mkdir /mnt/data: 只读文件系统 退避重新启动失败的容器。
我认为我需要将权限设置为 RWX ,当我尝试登录到 pod 时,即在容器内..它不允许登录。
任何人请帮助我!
这是我用于 Postgres 的 Yaml 文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
selector:
matchLabels:
app: postgres
replicas: 1
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:latest
imagePullPolicy: "IfNotPresent"
envFrom:
- configMapRef:
name: postgres-config
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: postgres-pv-volume
labels: …
Run Code Online (Sandbox Code Playgroud) postgresql docker google-kubernetes-engine devops google-cloud-registry
我正在尝试使用 terraform 创建一个 kubernetes 集群,但它向我显示了一个错误,我在不同的场合更改了版本的值,但没有奏效。
resource "digitalocean_kubernetes_cluster" "lox" {
name = "lox"
region = "nyc1"
version = "1.13.4-do.0"
node_pool {
name = "worker-pool"
size = "s-1vcpu-2gb"
node_count = 2
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
Error: Error creating Kubernetes cluster: POST https://api.digitalocean.com/v2/kubernetes/clusters: 422 validation error: invalid version slug
on 01-cluster.tf line 1, in resource "digitalocean_kubernetes_cluster" "lox":
1: resource "digitalocean_kubernetes_cluster" "lox" {
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
devops ×10
docker ×3
linux ×2
.net ×1
architecture ×1
automation ×1
azure ×1
azure-devops ×1
bitbucket ×1
build ×1
build-server ×1
dockerfile ×1
jinja2 ×1
json ×1
kubernetes ×1
postgresql ×1
salt-stack ×1
shell ×1
terraform ×1