forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-nginx-services-through-ingress.yml
170 lines (170 loc) · 4.86 KB
/
deploy-nginx-services-through-ingress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Deploy Nginx and expose and monitor services through Ingress.
zh-cn: 部署Nginx并通过Ingress暴露和监控服务。
Parameters:
AckName:
Type: String
Label:
en: Cluster Name
zh-cn: 集群名称
Description:
en: The name must be 1 to 63 characters in length and can contain letters, Chinese
characters, digits, and hyphens (-).
zh-cn: 名称为1~63个字符,可包含数字、汉字、英文字符或中划线(-)。
AllowedPattern: ^[a-zA-Z0-9\u4e00-\u9fa5][-a-zA-Z0-9\u4e00-\u9fa5]{0,62}$
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: cluster-for-nginx-
CharacterClasses:
- Class: lowercase
min: 1
ZoneId:
Type: String
Label:
en: VSwitch Available Zone
zh-cn: 可用区
AssociationProperty: ALIYUN::VPC::Zone::ZoneId
Description:
en: If the available zone cannot be selected, please switch regions.
zh-cn: 如果选择不到可用区,请切换地域。
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 节点规格
Description:
en: It is recommended to use a new generation of ecs instances. If the instance
specification cannot be selected, please change the availability zone again.
zh-cn: 建议使用新一代的 ecs 实例,如果选择不到实例规格,请重新更换可用区。
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
CreateACKClusterParams:
NetworkPlugin: terway-eniip
CommonName:
Type: String
Default: ack-for-nginx
Resources:
ModuleAcsCsProvision:
Type: MODULE::ACS::CS::Provision
Version: default
DependsOn: EnableServiceSls
EnableServiceSls:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: SLS
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Sub: ${CommonName}-vpc
Vswitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
VSwitchName:
Fn::Sub: ${CommonName}-${ZoneId}-vsw
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
SecurityGroupIngress:
- PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
SecurityGroupEgress:
- PortRange: -1/-1
Priority: 1
IpProtocol: all
DestCidrIp: 0.0.0.0/0
NicType: internet
- PortRange: -1/-1
Priority: 1
IpProtocol: all
DestCidrIp: 0.0.0.0/0
NicType: intranet
RandomString:
Type: ALIYUN::RandomString
Properties:
length: 10
character_classes:
- class: lowercase
min: 1
- class: uppercase
min: 1
- class: digits
min: 1
character_sequences:
- sequence: '!@#$%^&*()_+-='
min: 1
Ack:
Type: ALIYUN::CS::ManagedKubernetesCluster
Properties:
VpcId:
Ref: Vpc
VSwitchIds:
- Ref: Vswitch
PodVswitchIds:
- Ref: Vswitch
Name:
Ref: AckName
NumOfNodes: 3
ClusterSpec: ack.pro.small
ServiceCidr: 172.16.0.0/16
Addons:
- Name: security-inspector
- Name: terway-eniip
Config: '{"IPVlan":"false","NetworkPolicy":"false","ENITrunking":"false"}'
- Name: csi-plugin
- Name: csi-provisioner
- Name: storage-operator
Config: '{"CnfsOssEnable":"false","CnfsNasEnable":"false"}'
- Name: logtail-ds
Config: '{"IngressDashboardEnabled":"true"}'
- Name: nginx-ingress-controller
Config: '{"IngressSlbNetworkType":"internet","IngressSlbSpec":"slb.s2.small"}'
- Name: ack-node-local-dns
- Name: arms-prometheus
- Name: ack-node-problem-detector
Config: '{"sls_project_name":""}'
EndpointPublicAccess: false
SnatEntry: true
LoadBalancerSpec: slb.s1.small
IsEnterpriseSecurityGroup: false
WorkerInstanceTypes:
- Ref: InstanceType
WorkerSystemDiskCategory: cloud_essd
WorkerSystemDiskSize: 40
LoginPassword:
Fn::GetAtt:
- RandomString
- value
Runtime:
Name: containerd
Version: 1.6.20
DependsOn:
- ModuleAcsCsProvision
- EnableServiceSls
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- AckName
- ZoneId
- InstanceType
Hidden:
- CommonName
TemplateTags:
- acs:technical-solution:ops-on-cloud:部署Nginx并通过Ingress暴露和监控服务-tech_solu_16