Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more goldenfile tests #614

Merged
merged 9 commits into from
Oct 31, 2023
Merged
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
port:
name: main-port
path: /
pathType: ImplementationSpecific
pathType: ImplementationSpecific
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions testdata/ingress_rg_notshared_alb/k8s/ing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myingress
spec:
rules:
- host: foo.bar.org
http:
paths:
- backend:
service:
name: foo-bar-service
port:
name: main-port
path: /
pathType: ImplementationSpecific
18 changes: 18 additions & 0 deletions testdata/ingress_rg_notshared_alb/k8s/rg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: zalando.org/v1
kind: RouteGroup
metadata:
name: my-route-group
annotations:
zalando.org/aws-load-balancer-shared: "false"
lucastt marked this conversation as resolved.
Show resolved Hide resolved
spec:
hosts:
- foo.bar.org
backends:
- name: my-backend
type: service
serviceName: my-service
servicePort: 80
routes:
- pathSubtree: /
backends:
- backendName: my-backend
54 changes: 54 additions & 0 deletions testdata/ingress_rg_notshared_alb/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"parameterKey": "LoadBalancerSchemeParameter",
"parameterValue": "internet-facing"
},
{
"parameterKey": "LoadBalancerSecurityGroupParameter",
"parameterValue": "42"
},
{
"parameterKey": "LoadBalancerSubnetsParameter",
"parameterValue": "foo1"
},
{
"parameterKey": "TargetGroupVPCIDParameter",
"parameterValue": "1"
},
{
"parameterKey": "TargetGroupTargetPortParameter",
"parameterValue": "0"
},
{
"parameterKey": "ListenerSslPolicyParameter",
"parameterValue": "ELBSecurityPolicy-2016-08"
},
{
"parameterKey": "IpAddressType",
"parameterValue": "ipv4"
},
{
"parameterKey": "Type",
"parameterValue": "application"
},
{
"parameterKey": "HTTP2",
"parameterValue": "true"
},
{
"parameterKey": "TargetGroupHealthCheckPathParameter",
"parameterValue": ""
},
{
"parameterKey": "TargetGroupHealthCheckPortParameter",
"parameterValue": "0"
},
{
"parameterKey": "TargetGroupHealthCheckIntervalParameter",
"parameterValue": "0"
},
{
"parameterKey": "TargetGroupHealthCheckTimeoutParameter",
"parameterValue": "0"
}
]
15 changes: 15 additions & 0 deletions testdata/ingress_rg_notshared_alb/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"key": "kubernetes:application",
"value": ""
},{
"key": "kubernetes.io/cluster/aws:123:eu-central-1:kube-1",
"value": "owned"
},{
"key": "ingress:certificate-arn/DUMMY",
"value": "0001-01-01T00:00:00Z"
},{
"key": "ingress:owner",
"value": "/my-route-group"
}
]
219 changes: 219 additions & 0 deletions testdata/ingress_rg_notshared_alb/template.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Load Balancer for Kubernetes Ingress",
"Parameters": {
"HTTP2": {
"Type": "String",
"Default": "true",
"Description": "H2 Enabled"
},
"IpAddressType": {
"Type": "String",
"Default": "ipv4",
"Description": "IP Address Type, 'ipv4' or 'dualstack'"
},
"ListenerSslPolicyParameter": {
"Type": "String",
"Default": "ELBSecurityPolicy-2016-08",
"Description": "The HTTPS SSL Security Policy Name"
},
"LoadBalancerSchemeParameter": {
"Type": "String",
"Default": "internet-facing",
"Description": "The Load Balancer scheme - 'internal' or 'internet-facing'"
},
"LoadBalancerSecurityGroupParameter": {
"Type": "List\u003cAWS::EC2::SecurityGroup::Id\u003e",
"Description": "The security group ID for the Load Balancer"
},
"LoadBalancerSubnetsParameter": {
"Type": "List\u003cAWS::EC2::Subnet::Id\u003e",
"Description": "The list of subnets IDs for the Load Balancer"
},
"TargetGroupHealthCheckIntervalParameter": {
"Type": "Number",
"Default": "10",
"Description": "The healthcheck interval"
},
"TargetGroupHealthCheckPathParameter": {
"Type": "String",
"Default": "/kube-system/healthz",
"Description": "The healthcheck path"
},
"TargetGroupHealthCheckPortParameter": {
"Type": "Number",
"Default": "9999",
"Description": "The healthcheck port"
},
"TargetGroupHealthCheckTimeoutParameter": {
"Type": "Number",
"Default": "5",
"Description": "The healthcheck timeout"
},
"TargetGroupTargetPortParameter": {
"Type": "Number",
"Default": "9999",
"Description": "The target port"
},
"TargetGroupVPCIDParameter": {
"Type": "AWS::EC2::VPC::Id",
"Description": "The VPCID for the TargetGroup"
},
"Type": {
"Type": "String",
"Default": "application",
"Description": "Loadbalancer Type, 'application' or 'network'"
}
},
"Resources": {
"HTTPListener": {
"Type": "AWS::ElasticLoadBalancingV2::Listener",
"Properties": {
"DefaultActions": [
{
"TargetGroupArn": {
"Ref": "TG"
},
"Type": "forward"
}
],
"LoadBalancerArn": {
"Ref": "LB"
},
"Port": 80,
"Protocol": "HTTP"
}
},
"HTTPSListener": {
"Type": "AWS::ElasticLoadBalancingV2::Listener",
"Properties": {
"Certificates": [
{
"CertificateArn": "DUMMY"
}
],
"DefaultActions": [
{
"TargetGroupArn": {
"Ref": "TG"
},
"Type": "forward"
}
],
"LoadBalancerArn": {
"Ref": "LB"
},
"Port": 443,
"Protocol": "HTTPS",
"SslPolicy": {
"Ref": "ListenerSslPolicyParameter"
}
}
},
"HTTPSListenerCertificatefc48082457b770e278fc0bd3d392d127869993166f76e8df57d19a0e662820ea": {
"Type": "AWS::ElasticLoadBalancingV2::ListenerCertificate",
"Properties": {
"Certificates": [
{
"CertificateArn": "DUMMY"
}
],
"ListenerArn": {
"Ref": "HTTPSListener"
}
}
},
"LB": {
lucastt marked this conversation as resolved.
Show resolved Hide resolved
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties": {
"IpAddressType": {
"Ref": "IpAddressType"
},
"LoadBalancerAttributes": [
{
"Key": "idle_timeout.timeout_seconds",
"Value": "0"
},
{
"Key": "routing.http2.enabled",
"Value": "true"
},
{
"Key": "access_logs.s3.enabled",
"Value": "false"
}
],
"Scheme": {
"Ref": "LoadBalancerSchemeParameter"
},
"SecurityGroups": {
"Ref": "LoadBalancerSecurityGroupParameter"
},
"Subnets": {
"Ref": "LoadBalancerSubnetsParameter"
},
"Tags": [
{
"Key": "StackName",
"Value": {
"Ref": "AWS::StackName"
}
}
],
"Type": {
"Ref": "Type"
}
}
},
"TG": {
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"HealthCheckIntervalSeconds": {
"Ref": "TargetGroupHealthCheckIntervalParameter"
},
"HealthCheckPath": {
"Ref": "TargetGroupHealthCheckPathParameter"
},
"HealthCheckPort": {
"Ref": "TargetGroupHealthCheckPortParameter"
},
"HealthCheckProtocol": "HTTP",
"HealthCheckTimeoutSeconds": {
"Ref": "TargetGroupHealthCheckTimeoutParameter"
},
"HealthyThresholdCount": 0,
"Port": {
"Ref": "TargetGroupTargetPortParameter"
},
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "deregistration_delay.timeout_seconds",
"Value": "0"
}
],
"UnhealthyThresholdCount": 0,
"VpcId": {
"Ref": "TargetGroupVPCIDParameter"
}
}
}
},
"Outputs": {
"LoadBalancerDNSName": {
"Description": "DNS name for the LoadBalancer",
"Value": {
"Fn::GetAtt": [
"LB",
"DNSName"
]
}
},
"TargetGroupARN": {
"Description": "The ARN of the TargetGroup",
"Value": {
"Ref": "TG"
}
}
}
}
16 changes: 16 additions & 0 deletions testdata/ingress_rg_shared_alb/k8s/ing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myingress
spec:
rules:
- host: foo.bar.org
http:
paths:
- backend:
service:
name: foo-bar-service
port:
name: main-port
path: /
pathType: ImplementationSpecific
18 changes: 18 additions & 0 deletions testdata/ingress_rg_shared_alb/k8s/rg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: zalando.org/v1
kind: RouteGroup
metadata:
name: my-route-group
annotations:
zalando.org/aws-load-balancer-shared: "true"
spec:
hosts:
- foo.bar.org
backends:
- name: my-backend
type: service
serviceName: my-service
servicePort: 80
routes:
- pathSubtree: /
backends:
- backendName: my-backend
Loading
Loading