Skip to content

Commit

Permalink
feat: add subnet discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
ReuDa committed Jan 13, 2025
1 parent f4c0c86 commit 8119399
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- don't cache zones forever (for example removed permissions should lead to removed targets in the platform)
- include tags in the discovery of Lambda functions (requires new permission `tag:GetResources`)
- add vpc name to targets (requires new permission `ec2:DescribeVpcs`, can be disabled by `STEADYBIT_EXTENSION_DISCOVERY_DISABLED_VPC`)
- add subnet target discovery

## v2.3.6

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ our [Reliability Hub](https://hub.steadybit.com/extension/com.steadybit.extensio
| `STEADYBIT_EXTENSION_DISCOVERY_INTERVAL_LAMBDA` | | Discovery-Interval in seconds | no | 60 |
| `STEADYBIT_EXTENSION_DISCOVERY_DISABLED_RDS` | `aws.discovery.disabled.rds` | Disable RDS-Discovery and all related definitions | no | false |
| `STEADYBIT_EXTENSION_DISCOVERY_INTERVAL_RDS` | | Discovery-Interval in seconds | no | 30 |
| `STEADYBIT_EXTENSION_DISCOVERY_DISABLED_SUBNET` | `aws.discovery.disabled.subnet` | Disable Subnet-Discovery and all related definitions | no | false |
| `STEADYBIT_EXTENSION_DISCOVERY_INTERVAL_SUBNET` | | Discovery-Interval in seconds | no | 30 |
| `STEADYBIT_EXTENSION_DISCOVERY_DISABLED_VPC` | `aws.discovery.disabled.vpc` | Disable VPC-Discovery and all related definitions | no | false |
| `STEADYBIT_EXTENSION_DISCOVERY_DISABLED_ZONE` | `aws.discovery.disabled.zone` | Disable Zone-Discovery and all related definitions | no | false |
| `STEADYBIT_EXTENSION_DISCOVERY_INTERVAL_ZONE` | | Discovery-Interval in seconds | no | 300 |
Expand All @@ -45,6 +47,7 @@ our [Reliability Hub](https://hub.steadybit.com/extension/com.steadybit.extensio
| `STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_MSK` | `aws.discovery.attributes.excludes.msk` | List of MSK Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | no | |
| `STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_LAMBDA` | `aws.discovery.attributes.excludes.lambda` | List of Lambda Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | no | |
| `STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_RDS` | `aws.discovery.attributes.excludes.rds` | List of RDS Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | no | |
| `STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_SUBNET` | `aws.discovery.attributes.excludes.subnet` | List of Subnet Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | no | |
| `STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_ZONE` | `aws.discovery.attributes.excludes.zone` | List of Availibilty Zone Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | no | |

The extension supports all environment variables provided by [steadybit/extension-kit](https://github.com/steadybit/extension-kit#environment-variables).
Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-extension-aws/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: steadybit-extension-aws
description: Steadybit AWS extension Helm chart for Kubernetes.
version: 2.1.24
version: 2.1.25
appVersion: v2.3.6
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
Expand Down
16 changes: 16 additions & 0 deletions charts/steadybit-extension-aws/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ spec:
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_RDS
value: {{ join "," .Values.aws.discovery.attributes.excludes.rds | quote }}
{{- end }}
{{- if .Values.aws.discovery.attributes.excludes.subnet }}
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_SUBNET
value: {{ join "," .Values.aws.discovery.attributes.excludes.subnet | quote }}
{{- end }}
{{- if .Values.aws.discovery.attributes.excludes.vpc }}
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_VPC
value: {{ join "," .Values.aws.discovery.attributes.excludes.vpc | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -155,6 +163,14 @@ spec:
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_RDS
value: "true"
{{- end }}
{{- if .Values.aws.discovery.disabled.subnet }}
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_SUBNET
value: "true"
{{- end }}
{{- if .Values.aws.discovery.disabled.vpc }}
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_VPC
value: "true"
{{- end }}
{{- if .Values.aws.discovery.disabled.zone }}
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_ZONE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ manifest should add aws env vars:
value: example.lambda.1,example.lambda.2
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_RDS
value: example.rds.1,example.rds.2
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_SUBNET
value: example.subnet.1,example.subnet.2
- name: STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_VPC
value: example.vpc.1,example.vpc.2
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_EC2
value: "true"
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_ECS
Expand All @@ -64,6 +68,10 @@ manifest should add aws env vars:
value: "true"
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_RDS
value: "true"
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_SUBNET
value: "true"
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_VPC
value: "true"
- name: STEADYBIT_EXTENSION_DISCOVERY_DISABLED_ZONE
value: "true"
image: ghcr.io/steadybit/extension-aws:v0.0.0
Expand Down
8 changes: 8 additions & 0 deletions charts/steadybit-extension-aws/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ tests:
fis: true
lambda: true
rds: true
subnet: true
zone: true
vpc: true
attributes:
excludes:
ec2:
Expand All @@ -44,9 +46,15 @@ tests:
rds:
- "example.rds.1"
- "example.rds.2"
subnet:
- "example.subnet.1"
- "example.subnet.2"
zone:
- "example.zone.1"
- "example.zone.2"
vpc:
- "example.vpc.1"
- "example.vpc.2"
asserts:
- matchSnapshot: {}
- it: manifest should match snapshot using podAnnotations and Labels
Expand Down
4 changes: 4 additions & 0 deletions charts/steadybit-extension-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ aws:
lambda: false
# aws.discovery.disabled.rds -- Disables RDS discovery and the related actions.
rds: false
# aws.discovery.disabled.subnet -- Disables Subnet discovery and the related actions.
subnet: false
# aws.discovery.disabled.vpc -- Disables VPC discovery and the related actions.
vpc: false
# aws.discovery.disabled.zone -- Disables AZ discovery and the related actions.
Expand All @@ -45,6 +47,8 @@ aws:
msk: []
# aws.discovery.attributes.excludes.lambda -- List of attributes to exclude from Lambda discovery.
lambda: []
# aws.discovery.attributes.excludes.subnet -- List of attributes to exclude from Subnet discovery.
subnet: []
# aws.discovery.attributes.excludes.rds -- List of attributes to exclude from RDS discovery.
rds: []
# aws.discovery.attributes.excludes.zone -- List of attributes to exclude from AZ discovery.
Expand Down
5 changes: 4 additions & 1 deletion config/specification.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type Specification struct {
DiscoveryDisabledMsk bool `json:"discoveryDisabledMsk" split_words:"true" required:"false" default:"false"`
DiscoveryDisabledLambda bool `json:"discoveryDisabledLambda" split_words:"true" required:"false" default:"false"`
DiscoveryDisabledRds bool `json:"discoveryDisabledRds" split_words:"true" required:"false" default:"false"`
DiscoveryDisabledSubnet bool `json:"discoveryDisabledSubnet" split_words:"true" required:"false" default:"false"`
DiscoveryDisabledZone bool `json:"discoveryDisabledZone" split_words:"true" required:"false" default:"false"`
DiscoveryIntervalEc2 int `json:"discoveryIntervalEc2" split_words:"true" required:"false" default:"30"`
DiscoveryDisabledVpc bool `json:"discoveryDisabledVpc" split_words:"true" required:"false" default:"false"`
DiscoveryIntervalEc2 int `json:"discoveryIntervalEc2" split_words:"true" required:"false" default:"30"`
DiscoveryIntervalEcsService int `json:"discoveryIntervalEcsService" split_words:"true" required:"false" default:"30"`
DiscoveryIntervalEcsTask int `json:"discoveryIntervalEcsTask" split_words:"true" required:"false" default:"30"`
DiscoveryIntervalElasticacheReplicationGroup int `json:"discoveryIntervalElasticacheReplicationGroup" split_words:"true" required:"false" default:"30"`
Expand All @@ -27,6 +28,7 @@ type Specification struct {
DiscoveryIntervalFis int `json:"discoveryIntervalFis" split_words:"true" required:"false" default:"300"`
DiscoveryIntervalLambda int `json:"discoveryIntervalLambda" split_words:"true" required:"false" default:"60"`
DiscoveryIntervalRds int `json:"discoveryIntervalRds" split_words:"true" required:"false" default:"30"`
DiscoveryIntervalSubnet int `json:"discoveryIntervalSubnet" split_words:"true" required:"false" default:"30"`
DiscoveryIntervalZone int `json:"discoveryIntervalZone" split_words:"true" required:"false" default:"300"`
EnrichEc2DataForTargetTypes []string `json:"EnrichEc2DataForTargetTypes" split_words:"true" default:"com.steadybit.extension_jvm.jvm-instance,com.steadybit.extension_container.container,com.steadybit.extension_kubernetes.kubernetes-deployment,com.steadybit.extension_kubernetes.kubernetes-pod,com.steadybit.extension_kubernetes.kubernetes-daemonset,com.steadybit.extension_kubernetes.kubernetes-statefulset,com.steadybit.extension_http.client-location,com.steadybit.extension_jmeter.location,com.steadybit.extension_k6.location,com.steadybit.extension_gatling.location"`
EnrichEc2DataMatcherAttribute string `json:"EnrichEc2DataMatcherAttribute" split_words:"true" default:"host.hostname"`
Expand All @@ -38,6 +40,7 @@ type Specification struct {
DiscoveryAttributesExcludesMsk []string `json:"discoveryAttributesExcludesMsk" split_words:"true" required:"false"`
DiscoveryAttributesExcludesLambda []string `json:"discoveryAttributesExcludesLambda" split_words:"true" required:"false"`
DiscoveryAttributesExcludesRds []string `json:"discoveryAttributesExcludesRds" split_words:"true" required:"false"`
DiscoveryAttributesExcludesSubnet []string `json:"discoveryAttributesExcludesSubnet" split_words:"true" required:"false"`
DiscoveryAttributesExcludesZone []string `json:"discoveryAttributesExcludesZone" split_words:"true" required:"false"`
DisableDiscoveryExcludes bool `required:"false" split_words:"true" default:"false"`
}
2 changes: 2 additions & 0 deletions extec2/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ const (
ec2InstanceStateActionId = "com.steadybit.extension_aws.ec2_instance.state"
ec2TargetType = "com.steadybit.extension_aws.ec2-instance"
ec2Icon = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.04%202.54998C21.83%202.33998%2021.56%202.22998%2021.27%202.22998H11.79C11.5%202.22998%2011.23%202.33998%2011.02%202.54998C10.81%202.75998%2010.7%203.02998%2010.7%203.31998V5.59998H12.09V3.61998H20.97V12.51H18.99V13.9H21.27C21.56%2013.9%2021.84%2013.78%2022.04%2013.58C22.25%2013.37%2022.36%2013.1%2022.36%2012.81V3.31998C22.36%203.02998%2022.25%202.74998%2022.04%202.54998ZM12.27%2021.2H3.39V12.32H5.37V10.93H3.09C2.8%2010.93%202.53%2011.04%202.32%2011.25C2.11%2011.46%202%2011.73%202%2012.02V21.5C2%2021.79%202.11%2022.06%202.32%2022.27C2.53%2022.48%202.8%2022.59%203.09%2022.59H12.57C12.86%2022.59%2013.13%2022.48%2013.34%2022.27C13.54%2022.07%2013.66%2021.79%2013.66%2021.5V19.22H12.27V21.2ZM16.83%207.02998C17%207.08998%2017.15%207.17998%2017.28%207.30998C17.41%207.43998%2017.5%207.58998%2017.56%207.75998H18.8V9.14998H17.61V9.73998H18.8V11.13H17.61V11.72H18.8V13.11H17.61V13.69H18.8V15.08H17.61V15.66H18.8V17.05H17.56C17.5%2017.22%2017.41%2017.37%2017.28%2017.5C17.15%2017.63%2017%2017.72%2016.83%2017.78V19.02H15.44V17.83H14.86V19.02H13.47V17.83H12.89V19.02H11.5V17.83H10.91V19.02H9.52001V17.83H8.93001V19.02H7.54001V17.78C7.37001%2017.72%207.22001%2017.62%207.09001%2017.5C6.96001%2017.38%206.87001%2017.22%206.81001%2017.05H5.57001V15.66H6.76001V15.08H5.57001V13.69H6.76001V13.11H5.57001V11.72H6.76001V11.13H5.57001V9.73998H6.76001V9.14998H5.57001V7.75998H6.81001C6.87001%207.58998%206.96001%207.43998%207.09001%207.30998C7.21001%207.17998%207.37001%207.08998%207.54001%207.02998V5.78998H8.93001V6.97998H9.52001V5.78998H10.91V6.97998H11.5V5.78998H12.89V6.97998H13.47V5.78998H14.86V6.97998H15.44V5.78998H16.83V7.02998ZM8.14001%2016.46H16.23V16.45V8.35998H8.14001V16.46Z%22%20fill%3D%22currentColor%22%2F%3E%0A%3C%2Fsvg%3E"
subnetTargetType = "com.steadybit.extension_aws.ec2-subnet"
subnetIcon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCAyMiAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjE3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