Skip to content

Commit 2c3c386

Browse files
authored
feat: add keda helm chart (#170)
1 parent c02d302 commit 2c3c386

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ We use GitHub Actions and [tfsec](https://github.com/aquasecurity/tfsec) to chec
532532
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[3]' allows egress traffic to the internet | We don't want to deny egress traffic in a default installation |
533533
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[2]' allows all egress traffic by default | We don't want to deny egress traffic in a default installation |
534534
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[1]' allows all egress traffic by default | We don't want to deny egress traffic in a default installation |
535+
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.keda_namespace:kubernetes_network_policy.this[2]' allows egress traffic to the internet | We don't want to deny egress traffic in a default installation |
536+
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.keda_namespace:kubernetes_network_policy.this[1]' allows all egress traffic by default | We don't want to deny egress traffic in a default installation |
537+
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-egress | Resource 'module.keda_namespace:kubernetes_network_policy.this[0]' allows all egress traffic by default | We don't want to deny egress traffic in a default installation |
535538
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.reloader_namespace:kubernetes_network_policy.this[0]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
536539
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.certmanager_namespace:kubernetes_network_policy.this[3]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
537540
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.cluster_autoscaler_namespace:kubernetes_network_policy.this[3]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
@@ -560,6 +563,8 @@ We use GitHub Actions and [tfsec](https://github.com/aquasecurity/tfsec) to chec
560563
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[3]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
561564
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[0]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
562565
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.aws_load_balancer_controller_namespace[0]:kubernetes_network_policy.this[2]' allows ingress traffic from the internet | We allow traffic from 0.0.0.0/0 to trigger webhooks only on certain port and certain pods |
566+
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.keda_namespace:kubernetes_network_policy.this[2]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
567+
| modules/kubernetes-namespace/network-policy.tf | kubernetes-network-no-public-ingress | Resource 'module.keda_namespace:kubernetes_network_policy.this[0]' allows all ingress traffic by default | We deny all ingress trafic by default, but tfsec doesn't work as expected (bug) |
563568
564569
565570
## Contributing

terraform/layer2-k8s/eks-keda.tf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
locals {
2+
keda = {
3+
chart = local.helm_charts[index(local.helm_charts.*.id, "keda")].chart
4+
repository = lookup(local.helm_charts[index(local.helm_charts.*.id, "keda")], "repository", null)
5+
chart_version = lookup(local.helm_charts[index(local.helm_charts.*.id, "keda")], "version", null)
6+
}
7+
}
8+
9+
#tfsec:ignore:kubernetes-network-no-public-egress tfsec:ignore:kubernetes-network-no-public-ingress
10+
module "keda_namespace" {
11+
source = "../modules/kubernetes-namespace"
12+
name = "keda"
13+
network_policies = [
14+
{
15+
name = "default-deny"
16+
policy_types = ["Ingress", "Egress"]
17+
pod_selector = {}
18+
},
19+
{
20+
name = "allow-this-namespace"
21+
policy_types = ["Ingress"]
22+
pod_selector = {}
23+
ingress = {
24+
from = [
25+
{
26+
namespace_selector = {
27+
match_labels = {
28+
name = "keda"
29+
}
30+
}
31+
}
32+
]
33+
}
34+
},
35+
{
36+
name = "allow-egress"
37+
policy_types = ["Egress"]
38+
pod_selector = {}
39+
egress = {
40+
to = [
41+
{
42+
ip_block = {
43+
cidr = "0.0.0.0/0"
44+
except = [
45+
"169.254.169.254/32"
46+
]
47+
}
48+
}
49+
]
50+
}
51+
}
52+
]
53+
}
54+
55+
resource "helm_release" "kedacore" {
56+
name = "keda"
57+
chart = local.keda.chart
58+
repository = local.keda.repository
59+
version = local.keda.chart_version
60+
namespace = module.keda_namespace.name
61+
wait = true
62+
max_history = var.helm_release_history_size
63+
}

terraform/layer2-k8s/helm-charts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ charts:
5959
chart: ../../helm-charts/istio/istio-resources
6060
repository:
6161
version:
62+
- id: keda
63+
chart: keda
64+
repository: https://kedacore.github.io/charts
65+
version: 2.4.0
6266
- id: kiali-server
6367
chart: kiali-server
6468
repository: https://kiali.org/helm-charts

0 commit comments

Comments
 (0)