Skip to content

Commit dfcebac

Browse files
committed
fix: fix load balancer bits
1 parent cf6cbc1 commit dfcebac

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

aws/k8s-aws-alb-script.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ echo "do helm eks application"
4242
helm repo add eks https://aws.github.io/eks-charts
4343
helm repo update
4444

45+
LOAD_BALANCER_CONTROLLER_ROLE_ARN="$(terraform output -raw load_balancer_controller_role_arn)"
46+
kubectl create serviceaccount -n kube-system aws-load-balancer-controller
47+
kubectl annotate serviceaccount -n kube-system --overwrite aws-load-balancer-controller eks.amazonaws.com/role-arn=${LOAD_BALANCER_CONTROLLER_ROLE_ARN}
48+
4549
echo "upgrade alb controller with helm"
4650
helm upgrade -i aws-load-balancer-controller \
4751
eks/aws-load-balancer-controller \

aws/k8s/workspace-psa.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ kind: Namespace
33
metadata:
44
name: default
55
labels:
6-
pod-security.kubernetes.io/enforce: restricted
6+
pod-security.kubernetes.io/audit: restricted
7+
# pod-security.kubernetes.io/enforce: baseline
78
kubernetes.io/metadata.name: default

aws/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ output "cluster_autoscaler_role_arn" {
5454
value = module.cluster_autoscaler_irsa_role.iam_role_arn
5555
}
5656

57+
output "load_balancer_controller_role" {
58+
description = "Load balancer controller role"
59+
value = module.load_balancer_controller_irsa_role.iam_role_name
60+
}
61+
62+
output "load_balancer_controller_role_arn" {
63+
description = "Load balancer controller role arn"
64+
value = module.load_balancer_controller_irsa_role.iam_role_arn
65+
}
66+
5767
output "state_bucket_name" {
5868
description = "Terraform s3 state bucket name"
5969
value = split(":", var.state_bucket_arn)[length(split(":", var.state_bucket_arn)) - 1]

helm/wrongsecrets-ctf-party/templates/wrongsecrets-balancer/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ spec:
2323
runAsUser: 1000
2424
runAsGroup: 3000
2525
fsGroup: 2000
26+
seccompProfile:
27+
type: RuntimeDefault
2628
serviceAccountName: wrongsecrets-balancer
2729
containers:
2830
- name: {{ .Chart.Name }}
@@ -96,6 +98,8 @@ spec:
9698
add:
9799
- CAP_NET_ADMIN
98100
- CAP_NET_BIND_SERVICE
101+
seccompProfile:
102+
type: RuntimeDefault
99103
volumeMounts:
100104
- name: config-volume
101105
mountPath: /home/app/config/

0 commit comments

Comments
 (0)