2 Star 0 Fork 0

HuaweiCloudDeveloper/huaweicloud-solution-gray-scale-publishing-based-on-nginx-ingress

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gray-scale-publishing-based-on-nginx-ingress.tf.json 7.70 KB
一键复制 编辑 原始数据 按行查看 历史
HWCloudSolution 提交于 2023-01-05 18:18 . 代码优化
{
"terraform": {
"required_providers": [
{
"huaweicloud": {
"source": "huawei.com/provider/huaweicloud",
"version": ">=1.41.0"
},
"kubernetes": {
"source": "hashicorp/provider/kubernetes",
"version": ">=2.5.0"
}
}
]
},
"provider": {
"huaweicloud": {
"cloud": "myhuaweicloud.com",
"endpoints": {
"iam": "iam.cn-north-4.myhuaweicloud.com",
"dns": "dns.cn-north-4.myhuaweicloud.com"
},
"insecure": true,
"region": "cn-north-4",
"auth_url": "https://iam.cn-north-4.myhuaweicloud.com/v3"
},
"kubernetes": {
"host": "${huaweicloud_cce_cluster.cluster.certificate_clusters.1.server}",
"client_certificate": "${base64decode(huaweicloud_cce_cluster.cluster.certificate_users.0.client_certificate_data)}",
"client_key": "${base64decode(huaweicloud_cce_cluster.cluster.certificate_users.0.client_key_data)}",
"cluster_ca_certificate": "${base64decode(huaweicloud_cce_cluster.cluster.certificate_clusters.0.certificate_authority_data)}"
}
},
"variable": {
"vpc_name": {
"default": "gray-scale-publishing-demo",
"description": "虚拟私有云名称,该模板使用新建VPC,不支持重名。取值范围:1-54个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)。默认为gray-scale-publishing-demo。",
"type": "string",
"nullable": "false"
},
"eip_size": {
"default": "10",
"description": "弹性公网IP的带宽大小,单位:Mbit/s,默认按带宽计费。取值范围:1-2,000。默认为10。",
"type": "string",
"nullable": "false"
},
"cce_name": {
"default": "gray-scale-publishing-demo",
"description": "云容器引擎 CCE名称,取值范围:4-128个字符,以小写字母开头,由小写字母、数字、中划线(-)组成,且不能以中划线(-)结尾。默认为gray-scale-publishing-demo。",
"type": "string",
"nullable": "false"
},
"cce_node_name": {
"default": "gray-scale-publishing-demo",
"description": "集群节点名称,取值范围:1-50个字符,以小写字母开头,由小写字母、数字、中划线(-)组成,且不能以中划线(-)结尾。默认为gray-scale-publishing-demo。",
"type": "string",
"nullable": "false"
},
"cce_node_password": {
"default": "",
"description": "CCE集群Node节点初始化密码,用于集群节点登录,创建完成后请参考部署指南修改密码。取值范围:8~26个字符,密码至少必须包含大写字母、小写字母、数字和特殊字符(!@$%^-_=+[{}]:,./?)中的三种。",
"type": "string",
"nullable": "false",
"sensitive": "true"
},
"cce_flavor_id": {
"default": "cce.s2.small",
"description": "集群规格,集群创建完成后规格不可再变更,可选值:cce.s1.small、cce.s1.medium、cce.s2.small、cce.s2.medium、cce.s2.large、cce.s2.xlarge,具体请参考部署指南。默认cce.s2.small(小规模多控制节点CCE集群(最大50节点))。",
"type": "string",
"nullable": "false"
}
},
"data": {
"huaweicloud_availability_zones": {
"availability_zones": {}
},
"huaweicloud_cce_addon_template": {
"nginx-ingress": {
"name": "nginx-ingress",
"cluster_id": "${huaweicloud_cce_cluster.cluster.id}",
"version": "2.1.1"
}
}
},
"resource": {
"huaweicloud_vpc": {
"vpc": {
"cidr": "172.16.0.0/16",
"name": "${var.vpc_name}"
}
},
"huaweicloud_vpc_subnet": {
"subnet": {
"cidr": "172.16.10.0/24",
"gateway_ip": "172.16.10.1",
"name": "${var.vpc_name}-subnet",
"vpc_id": "${huaweicloud_vpc.vpc.id}"
}
},
"huaweicloud_vpc_eip": {
"eips": {
"bandwidth": {
"charge_mode": "bandwidth",
"name": "${var.vpc_name}-bandwidth",
"share_type": "PER",
"size": "${var.eip_size}"
},
"publicip": {
"type": "5_bgp"
},
"count": 2
}
},
"huaweicloud_lb_loadbalancer": {
"loadbalancer": {
"vip_subnet_id": "${huaweicloud_vpc_subnet.subnet.subnet_id}",
"name": "loadbalancer"
}
},
"huaweicloud_vpc_eip_associate": {
"lb_eip_bind": {
"public_ip": "${huaweicloud_vpc_eip.eips[0].address}",
"port_id": "${huaweicloud_lb_loadbalancer.loadbalancer.vip_port_id}"
}
},
"huaweicloud_cce_cluster": {
"cluster": {
"cluster_version": "v1.19",
"container_network_type": "vpc-router",
"flavor_id": "${var.cce_flavor_id}",
"eip": "${huaweicloud_vpc_eip.eips[1].address}",
"name": "${var.cce_name}",
"subnet_id": "${huaweicloud_vpc_subnet.subnet.id}",
"vpc_id": "${huaweicloud_vpc.vpc.id}"
}
},
"huaweicloud_cce_node": {
"node": {
"cluster_id": "${huaweicloud_cce_cluster.cluster.id}",
"name": "${var.cce_node_name}",
"subnet_id": "${huaweicloud_vpc_subnet.subnet.id}",
"flavor_id": "c7.xlarge.2",
"availability_zone": "${data.huaweicloud_availability_zones.availability_zones.names[0]}",
"password": "${var.cce_node_password}",
"root_volume": [
{
"size": 40,
"volumetype": "SAS"
}
],
"data_volumes": [
{
"size": 100,
"volumetype": "SAS"
}
]
}
},
"huaweicloud_cce_addon": {
"nginx-ingress": {
"cluster_id": "${huaweicloud_cce_cluster.cluster.id}",
"template_name": "nginx-ingress",
"version": "${data.huaweicloud_cce_addon_template.nginx-ingress.version}",
"values": {
"basic": "${jsondecode(data.huaweicloud_cce_addon_template.nginx-ingress.spec).basic}",
"custom_json": "${jsonencode({\r\n \"service\": {\r\n \"annotations\": {\r\n \"kubernetes.io/elb.class\": \"union\",\r\n \"kubernetes.io/elb.id\": \"${huaweicloud_lb_loadbalancer.loadbalancer.id}\"\r\n },\r\n \"type\": \"LoadBalancer\",\r\n \"ports\": {\r\n \"http\": 80,\r\n \"https\": 443\r\n },\r\n \"targetPorts\": {\r\n \"http\": \"http\",\r\n \"https\": \"https\"\r\n },\r\n \"enableHttp\": true,\r\n \"enableHttps\": true,\r\n \"externalTrafficPolicy\": \"Cluster\"\r\n }\r\n})}",
"flavor_json": "${jsonencode({\r\n \"replicas\": 1,\r\n \"resources\": [\r\n {\r\n \"limitsCpu\": \"8000m\",\r\n \"limitsMem\": \"4000Mi\",\r\n \"name\": \"nginx-ingress\",\r\n \"requestsCpu\": \"500m\",\r\n \"requestsMem\": \"400Mi\"\r\n }\r\n ]\r\n})}"
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/HuaweiCloudDeveloper/huaweicloud-solution-gray-scale-publishing-based-on-nginx-ingress.git
git@gitee.com:HuaweiCloudDeveloper/huaweicloud-solution-gray-scale-publishing-based-on-nginx-ingress.git
HuaweiCloudDeveloper
huaweicloud-solution-gray-scale-publishing-based-on-nginx-ingress
huaweicloud-solution-gray-scale-publishing-based-on-nginx-ingress
master-dev

搜索帮助