Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ S3_RELEASE_PATH ?= s3://$(RELEASE_BUCKET)/releases/$(VERSION)
S3_RELEASE_LATEST ?= s3://$(RELEASE_BUCKET)/releases/latest
S3_BLEEDING_EDGE_LATEST ?= s3://$(RELEASE_BUCKET)/edge/latest
S3_EXPERIMENTAL_LATEST ?= s3://$(RELEASE_BUCKET)/experimental/latest
VERSION = 2.1.0
VERSION = 2.1.1

GCP_ONLY ?= false
GCP_PROJECT ?= goployer
Expand Down
80 changes: 72 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If other autoscaling groups of sample application already existed, for example `
2. Create a new launch template.
3. Create autoscaling group with launch template from the previous step. A newly created autoscaling group will be automatically attached to the target groups you specified in manifest.
4. Check all instances of all stacks are healty. Until all of them pass healthchecking, it won't go to the next step.
5. (optional) If you add `autoscaling` in manifest, goployer creates autoscaling policies and put these to the autoscaling group. If you use `alarms` with autoscaling, then goployer will also create a cloudwatch alarm for autoscaling policy.
5. (optional) If you add `autoscaling` in manifest, goployer creates autoscaling policies and put these to the autoscaling group. If you use `alarms` with autoscaling, then goployer should also create a cloudwatch alarm for autoscaling policy.
6. After all stacks are deployed, then goployer tries to delete previous versions of the same application.
Launch templates of previous autoscaling groups are also going to be deleted.

Expand Down Expand Up @@ -56,16 +56,10 @@ If other autoscaling groups of sample application already existed, for example `
spot_max_price: 0.3
```

You can see the detailed information in [manifest format](https://goployer.dev/docs/references/manifest/) page.
You should see the detailed information in [manifest format](https://goployer.dev/docs/references/manifest/) page.

<br>

## Examples
* You can find few examples of manifest file so that you can test it with this.
```bash
cd examples/manifests
```

## EBS Volume Configuration

Goployer supports advanced EBS volume management with the following features. You can find a complete example in [api-test-example.yaml](examples/manifests/api-test-example.yaml).
Expand Down Expand Up @@ -123,3 +117,73 @@ block_devices:
For a complete example showing how to use these features together, see [api-test-example.yaml](examples/manifests/api-test-example.yaml).


<br>

## # Network Interface Configuration
* You can configure multiple network interfaces (ENIs) for your instances.
* Both primary and secondary ENIs are optional configurations.
* If not specified, default network interface settings will be used.

### Security Group Configuration
Security groups can be configured in three ways:

1. Using Launch Template Security Groups (Default):
```yaml
security_groups:
- sg-12345678
```

2. Using Primary ENI Security Groups (Optional):
```yaml
primary_eni:
device_index: 0
subnet_id: subnet-12345678
security_groups:
- sg-12345678
```

3. Using Multiple ENIs with Security Groups (Optional):
```yaml
primary_eni:
device_index: 0
subnet_id: subnet-12345678
security_groups:
- sg-12345678

secondary_enis:
- device_index: 1
subnet_id: subnet-87654321
security_groups:
- sg-87654321
private_ip_address: 10.0.1.100
- device_index: 2
subnet_id: subnet-87654321
security_groups:
- sg-87654321
private_ip_address: 10.0.1.101
```

Note:
- You cannot use both ENI security groups and launch template security groups at the same time. You must choose either:
* Using launch template security groups (without ENI)
* Using ENI security groups (with ENI)
- Security group IDs must start with 'sg-' prefix
- ENI configuration is optional and should be used only when you need specific network interface configurations
- Each ENI (primary and secondary) must have at least one security group specified

### Network Interface Parameters
* `device_index`: The index of the network interface (0 for primary, 1+ for secondary)
* `subnet_id`: The ID of the subnet to attach the ENI to
* `security_groups`: List of security group IDs to associate with the ENI
* `private_ip_address`: (Optional) Specific private IP address to assign to the ENI
* `delete_on_termination`:
- If `true`: The ENI will be automatically deleted when the instance is terminated
- If `false`: The ENI will be preserved when the instance is terminated, allowing you to reuse it with another instance
- Primary ENI typically uses `true` to clean up resources
- Secondary ENIs often use `false` to preserve network configurations and IP addresses

## Examples
* You can find few examples of manifest file so that you can test it with this.
```bash
cd examples/manifests
```
126 changes: 126 additions & 0 deletions examples/manifests/basic-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,129 @@ stacks:
- ap-northeast-2c
target_groups:
- hello-artdapne2-ext
primary_eni:
device_index: 0
subnet_id: subnet-12345678
security_groups:
- default-artd_apnortheast2
delete_on_termination: true
secondary_enis:
- device_index: 1
subnet_id: subnet-87654321
security_groups:
- default-artd_apnortheast2
private_ip_address: 10.0.1.100
delete_on_termination: false
- device_index: 2
subnet_id: subnet-87654321
security_groups:
- default-artd_apnortheast2
private_ip_address: 10.0.1.101
delete_on_termination: false

- stack: artd-eni
polling_interval: 30s
account: dev
env: dev
replacement_type: BlueGreen
termination_delay_rate: 50
iam_instance_profile: app-hello-profile
ebs_optimized: true
block_devices:
- device_name: /dev/xvda
volume_size: 15
volume_type: "gp2"
- device_name: /dev/xvdb
volume_type: "st1"
volume_size: 500
capacity:
min: 4
max: 4
desired: 4
autoscaling: *autoscaling_policy
alarms: *autoscaling_alarms
lifecycle_callbacks:
pre_terminate_past_cluster:
- service hello stop

regions:
- region: ap-northeast-2
instance_type: t3.medium
ssh_key: test-master-key
ami_id: ami-01288945bd24ed49a
use_public_subnets: true
vpc: vpc-artd_apnortheast2
detailed_monitoring_enabled: false
healthcheck_target_group: hello-artdapne2-ext
availability_zones:
- ap-northeast-2a
- ap-northeast-2b
- ap-northeast-2c
target_groups:
- hello-artdapne2-ext
primary_eni:
device_index: 0
subnet_id: subnet-12345678
security_groups:
- default-artd_apnortheast2
delete_on_termination: true
secondary_enis:
- device_index: 1
subnet_id: subnet-87654321
security_groups:
- default-artd_apnortheast2
private_ip_address: 10.0.1.100
delete_on_termination: false
- device_index: 2
subnet_id: subnet-87654321
security_groups:
- default-artd_apnortheast2
private_ip_address: 10.0.1.101
delete_on_termination: false

- stack: artd-primary-eni
polling_interval: 30s
account: dev
env: dev
replacement_type: BlueGreen
termination_delay_rate: 50
iam_instance_profile: app-hello-profile
ebs_optimized: true
block_devices:
- device_name: /dev/xvda
volume_size: 15
volume_type: "gp2"
- device_name: /dev/xvdb
volume_type: "st1"
volume_size: 500
capacity:
min: 4
max: 4
desired: 4
autoscaling: *autoscaling_policy
alarms: *autoscaling_alarms
lifecycle_callbacks:
pre_terminate_past_cluster:
- service hello stop

regions:
- region: ap-northeast-2
instance_type: t3.medium
ssh_key: test-master-key
ami_id: ami-01288945bd24ed49a
use_public_subnets: true
vpc: vpc-artd_apnortheast2
detailed_monitoring_enabled: false
healthcheck_target_group: hello-artdapne2-ext
availability_zones:
- ap-northeast-2a
- ap-northeast-2b
- ap-northeast-2c
target_groups:
- hello-artdapne2-ext
primary_eni:
device_index: 0
subnet_id: subnet-12345678
security_groups:
- default-artd_apnortheast2
delete_on_termination: true
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/DevopsArtFactory/goployer

go 1.21
toolchain go1.24.1

require (
github.com/AlecAivazis/survey/v2 v2.1.0
Expand Down Expand Up @@ -53,8 +54,9 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
)
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -428,8 +428,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -465,14 +465,16 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Loading
Loading