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
171
172
173
| {
"id": "a422e02d0ab94ce23jk92a6d2bf8ff9c",
"lastModifiedBy": "cylon",
"metadata": {
"description": "启用或停用 HPA",
"name": "HPA Turn on or Turn off",
"owner": "cylonchau@outlook.com",
"scopes": [
"global"
]
},
"pipeline": {
"expectedArtifacts": [
{
"defaultArtifact": {
"artifactAccount": "k8s-cluster-102",
"reference": "https://git.chinamobile.cn/api/v4/projects/154/repository/files/hpa%2Fk8s-cluster-102%2F${ templateVariables.appName }.yaml/raw",
"type": "gitlab/file",
"version": "master"
},
"displayName": "${ templateVariables.appName }-hpa-file",
"id": "${ templateVariables.appName }-hpa",
"matchArtifact": {
"artifactAccount": "k8s-cluster-102",
"name": "https://git.chinamobile.cn/api/v4/projects/154/repository/files/hpa%2Fk8s-cluster-102%2F${ templateVariables.appName }.yaml/raw",
"type": "gitlab/file"
},
"useDefaultArtifact": true,
"usePriorArtifact": false
}
],
"keepWaitingPipelines": false,
"limitConcurrent": true,
"parameterConfig": [],
"stages": [
{
"instructions": "请选择条件: \n\tenable 启用 ${ templateVariables.appName } HPA Autoscaler\n\tdisable 禁用HPA Autoscaler\n",
"judgmentInputs": [
{
"value": "enable"
},
{
"value": "disable"
}
],
"name": "Apply",
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"notifications": [],
"propagateAuthenticationContext": false,
"refId": "7",
"requisiteStageRefIds": [],
"type": "manualJudgment"
},
{
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"name": "选择禁用 ${ templateVariables.appName } HPA",
"preconditions": [
{
"context": {
"expression": "${ #judgment('Apply') == 'disable' }"
},
"failPipeline": true,
"type": "expression"
}
],
"refId": "9",
"requisiteStageRefIds": [
"7"
],
"type": "checkPreconditions"
},
{
"name": "选择启用 ${ templateVariables.appName } HPA",
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"preconditions": [
{
"context": {
"expression": "${ #judgment('Apply HPA') == 'enable' }"
},
"failPipeline": true,
"type": "expression"
}
],
"refId": "10",
"requisiteStageRefIds": [
"7"
],
"type": "checkPreconditions"
},
{
"account": "${ templateVariables.dcName }",
"app": "${ templateVariables.appName }",
"cloudProvider": "kubernetes",
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"isNew": true,
"location": " ${ templateVariables.appLocation }",
"manifestName": "horizontalpodautoscaler ${ templateVariables.appName }-autoscaler",
"mode": "static",
"name": "禁用 ${ templateVariables.appName } HPA",
"options": {
"cascading": false,
"gracePeriodSeconds": 300
},
"refId": "12",
"requisiteStageRefIds": [
"9"
],
"type": "deleteManifest"
},
{
"account": "${ templateVariables.dcName }",
"cloudProvider": "kubernetes",
"manifestArtifactAccount": "k8s-cluster-102",
"manifestArtifactId": "${ templateVariables.appName }-hpa",
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"moniker": {
"app": "${ templateVariables.appName }"
},
"name": "启用 ${ templateVariables.appName } HPA",
"refId": "11",
"requisiteStageRefIds": [
"10"
],
"skipExpressionEvaluation": false,
"source": "artifact",
"stageTimeoutMs": 500000,
"trafficManagement": {
"enabled": false,
"options": {
"enableTraffic": false,
"services": []
}
},
"type": "deployManifest"
}
],
"triggers": []
},
"protect": false,
"schema": "v2",
"tag": null,
"updateTs": "1701832158029",
"variables": [
{
"defaultValue": "k8s-cluster-102",
"description": "要部署到的集群",
"name": "dcName",
"type": "string"
},
{
"defaultValue": "",
"description": "模块名称",
"name": "appName",
"type": "string"
},
{
"defaultValue": "public",
"description": "名称空间",
"name": "appLocation",
"type": "string"
}
]
}
|