Skip to content

Commit 9ad8ead

Browse files
committed
update casc docs to reflect new defaults, add unlisted fields to examples, and include EC2FleetLabelCloud examples
1 parent a629d36 commit 9ad8ead

File tree

1 file changed

+97
-29
lines changed

1 file changed

+97
-29
lines changed

docs/CONFIGURATION-AS-CODE.md

+97-29
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,62 @@
88

99
[Definition](https://github.com/jenkinsci/ec2-fleet-plugin/blob/master/src/main/java/com/amazon/jenkins/ec2fleet/EC2FleetCloud.java#L156-L179)
1010

11-
| Property | Type | Required | Description |
12-
|----------------------------|---------|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
13-
| name | string | yes, default ```""``` | A unique name for Jenkins cloud. "" signals the plugin to generate a unique default name for the Cloud. e.g. FleetCloud-jBGChqOP |
14-
| awsCredentialsId | string | no, default ```null``` | [Leave blank to use AWS EC2 instance role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) |
15-
| computerConnector | object | yes | for example ```sshConnector``` |
16-
| region | string | yes | ```us-east-2```, full [list](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html) |
17-
| fleet | string | yes | my-fleet |
18-
| endpoint | string | no | Set only if you need to use custome endpoint ```http://a.com``` |
19-
| fsRoot | string | no | my-root |
20-
| privateIpUsed | boolean | no, default ```false``` | connect to EC2 instance by private id instead of public |
21-
| alwaysReconnect | boolean | no, default ```false``` ||
22-
| labelString | string | yes ||
23-
| idleMinutes | int | no, default ```0``` ||
24-
| minSize | int | no, default ```0``` ||
25-
| maxSize | int | no, default ```0``` ||
26-
| minSpareSize | int | no, default ```0``` || minimum number of instances allowed to be idle, ready to pickup work. maxSize overrides minSpareSize. Such instances are exempted from 'Max Idle Minutes Before Scaledown' config.
27-
| maxTotalUses | int | no, default ```-1``` i.e. unlimited uses || maximum number of times a node can be used. Overrides minSize and minSpareSize, if set.
28-
| numExecutors | int | no, default ```1``` ||
29-
| addNodeOnlyIfRunning | boolean | no, default ```false``` ||
30-
| restrictUsage | boolean | no, default ```false``` | if ```true``` fleet nodes will executed only jobs with same label |
31-
| scaleExecutorsByWeight | boolean | no, default ```false``` ||
32-
| disableTaskResubmit | boolean | no, default ```false``` ||
33-
| initOnlineTimeoutSec | int | no, default ```180``` ||
34-
| initOnlineCheckIntervalSec | int | no, default ```15``` ||
35-
| cloudStatusIntervalSec | int | no, default ```10``` ||
36-
| noDelayProvision | boolean | no, default ```false``` ||
11+
| Property | Type | Required | Description |
12+
|----------------------------|---------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
13+
| name | string | yes, default ```"FleetCloud-XXXXXXXX"``` | A unique name for Jenkins cloud. "" signals the plugin to generate a unique default name for the Cloud. e.g. FleetCloud-jBGChqOP |
14+
| awsCredentialsId | string | no, default ```null``` | [Leave blank to use AWS EC2 instance role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) |
15+
| computerConnector | object | yes | for example ```sshConnector``` |
16+
| region | string | yes | ```us-east-2```, full [list](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html) |
17+
| fleet | string | yes | my-fleet |
18+
| endpoint | string | no | Set only if you need to use custom endpoint ```http://a.com``` |
19+
| fsRoot | string | no | my-root |
20+
| privateIpUsed | boolean | no, default ```false``` | connect to EC2 instance by private id instead of public |
21+
| alwaysReconnect | boolean | no, default ```false``` | |
22+
| labelString | string | yes | |
23+
| idleMinutes | int | no, default ```0``` | |
24+
| minSize | int | no, default ```1``` | |
25+
| maxSize | int | no, default ```1``` | |
26+
| minSpareSize | int | no, default ```0``` | | minimum number of instances allowed to be idle, ready to pickup work. maxSize overrides minSpareSize. Such instances are exempted from 'Max Idle Minutes Before Scaledown' config.
27+
| maxTotalUses | int | no, default ```-1``` i.e. unlimited uses | | maximum number of times a node can be used. Overrides minSize and minSpareSize, if set.
28+
| numExecutors | int | no, default ```1``` | |
29+
| addNodeOnlyIfRunning | boolean | no, default ```false``` | |
30+
| restrictUsage | boolean | no, default ```false``` | if ```true``` fleet nodes will executed only jobs with same label |
31+
| scaleExecutorsByWeight | boolean | no, default ```false``` | |
32+
| disableTaskResubmit | boolean | no, default ```false``` | |
33+
| initOnlineTimeoutSec | int | no, default ```180``` | |
34+
| initOnlineCheckIntervalSec | int | no, default ```15``` | |
35+
| cloudStatusIntervalSec | int | no, default ```10``` | |
36+
| noDelayProvision | boolean | no, default ```false``` | |
3737

3838
## EC2FleetLabelCloud
3939

4040
More about this type [here](LABEL-BASED-CONFIGURATION.md)
4141

4242
[Definition](https://github.com/jenkinsci/ec2-fleet-plugin/blob/master/src/main/java/com/amazon/jenkins/ec2fleet/EC2FleetLabelCloud.java#L123-L145)
4343

44+
| Property | Type | Required | Description |
45+
|----------------------------|---------|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
46+
| name | string | yes, default ```"FleetCloudLabel-XXXXXXXX"``` | A unique name for Jenkins cloud. "" signals the plugin to generate a unique default name for the Cloud. e.g. `FleetCloudLabel-jBGChqOP` |
47+
| awsCredentialsId | string | no, default ```null``` | [Leave blank to use AWS EC2 instance role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) |
48+
| computerConnector | object | yes | for example ```sshConnector``` |
49+
| region | string | yes | ```us-east-2```, full [list](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html) |
50+
| endpoint | string | no | Set only if you need to use custom endpoint ```http://a.com``` |
51+
| fsRoot | string | no | my-root |
52+
| privateIpUsed | boolean | no, default ```false``` | connect to EC2 instance by private id instead of public |
53+
| alwaysReconnect | boolean | no, default ```false``` | |
54+
| idleMinutes | int | no, default ```0``` | |
55+
| minSize | int | no, default ```1``` | |
56+
| maxSize | int | no, default ```1``` | |
57+
| maxTotalUses | int | no, default ```-1``` i.e. unlimited uses | | maximum number of times a node can be used. Overrides minSize and minSpareSize, if set.
58+
| numExecutors | int | no, default ```1``` | |
59+
| restrictUsage | boolean | no, default ```false``` | if ```true``` fleet nodes will executed only jobs with same label |
60+
| disableTaskResubmit | boolean | no, default ```false``` | |
61+
| initOnlineTimeoutSec | int | no, default ```180``` | |
62+
| initOnlineCheckIntervalSec | int | no, default ```15``` | |
63+
| cloudStatusIntervalSec | int | no, default ```10``` | |
64+
| noDelayProvision | boolean | no, default ```false``` | |
65+
| ec2KeyPairName | string | yes | AWS EC2 SSH Key-Pair Name |
66+
4467
## Examples
4568

4669
### EC2FleetCloud (min set of properties)
@@ -49,16 +72,15 @@ More about this type [here](LABEL-BASED-CONFIGURATION.md)
4972
jenkins:
5073
clouds:
5174
- ec2Fleet:
52-
name: ec2-fleet
75+
name: ""
5376
computerConnector:
5477
sshConnector:
5578
credentialsId: cred
5679
sshHostKeyVerificationStrategy:
5780
NonVerifyingKeyVerificationStrategy
5881
region: us-east-2
5982
fleet: my-fleet
60-
minSize: 1
61-
maxSize: 10
83+
labelString: ""
6284
```
6385
6486
### EC2FleetCloud (All properties)
@@ -81,6 +103,7 @@ jenkins:
81103
labelString: myLabel
82104
idleMinutes: 33
83105
minSize: 15
106+
minSpareSize: 20
84107
maxSize: 90
85108
numExecutors: 12
86109
addNodeOnlyIfRunning: true
@@ -92,3 +115,48 @@ jenkins:
92115
disableTaskResubmit: true
93116
noDelayProvision: true
94117
```
118+
119+
### EC2FleetLabelCloud (min set of properties)
120+
121+
```yaml
122+
jenkins:
123+
clouds:
124+
- ec2FleetLabel:
125+
name: ""
126+
computerConnector:
127+
sshConnector:
128+
credentialsId: cred
129+
sshHostKeyVerificationStrategy:
130+
NonVerifyingKeyVerificationStrategy
131+
region: us-east-2
132+
ec2KeyPairName: ec2KeyPair
133+
```
134+
135+
### EC2FleetLabelCloud (All properties)
136+
137+
```yaml
138+
jenkins:
139+
clouds:
140+
- ec2FleetLabel:
141+
name: ec2-fleet-label
142+
awsCredentialsId: xx
143+
computerConnector:
144+
sshConnector:
145+
credentialsId: cred
146+
region: us-east-2
147+
endpoint: http://a.com
148+
fsRoot: my-root
149+
privateIpUsed: true
150+
alwaysReconnect: true
151+
idleMinutes: 33
152+
minSize: 15
153+
maxSize: 90
154+
numExecutors: 12
155+
restrictUsage: true
156+
initOnlineTimeoutSec: 181
157+
initOnlineCheckIntervalSec: 13
158+
cloudStatusIntervalSec: 11
159+
disableTaskResubmit: true
160+
noDelayProvision: true
161+
ec2KeyPairName: ec2KeyPair
162+
```

0 commit comments

Comments
 (0)