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

fix: Make sure NLBs are provisioned #1136

Merged
merged 1 commit into from
Oct 1, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ data "aws_vpc" "this" {
}

resource "kubernetes_manifest" "ui_nlb" {
depends_on = [module.eks_blueprints_addons]

manifest = {
"apiVersion" = "v1"
"kind" = "Service"
"metadata" = {
"name" = "ui-nlb"
"namespace" = "ui"
"annotations" = {
"service.beta.kubernetes.io/aws-load-balancer-type" = "external "
"service.beta.kubernetes.io/aws-load-balancer-type" = "external"
"service.beta.kubernetes.io/aws-load-balancer-scheme" = "internet-facing"
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" = "instance"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ resource "time_sleep" "wait" {
}

resource "kubernetes_manifest" "ui_nlb" {
depends_on = [module.eks_blueprints_addons]

manifest = {
"apiVersion" = "v1"
"kind" = "Service"
"metadata" = {
"name" = "ui-nlb"
"namespace" = "ui"
"annotations" = {
"service.beta.kubernetes.io/aws-load-balancer-type" = "external "
"service.beta.kubernetes.io/aws-load-balancer-type" = "external"
"service.beta.kubernetes.io/aws-load-balancer-scheme" = "internet-facing"
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" = "instance"
}
Expand Down
4 changes: 3 additions & 1 deletion manifests/modules/security/irsa/.workshop/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ resource "time_sleep" "wait" {
}

resource "kubernetes_manifest" "ui_nlb" {
depends_on = [module.eks_blueprints_addons]

manifest = {
"apiVersion" = "v1"
"kind" = "Service"
"metadata" = {
"name" = "ui-nlb"
"namespace" = "ui"
"annotations" = {
"service.beta.kubernetes.io/aws-load-balancer-type" = "external "
"service.beta.kubernetes.io/aws-load-balancer-type" = "external"
"service.beta.kubernetes.io/aws-load-balancer-scheme" = "internet-facing"
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" = "instance"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ sidebar_position: 35
Now, with the `carts` Service Account associated with the authorized IAM role, the `carts` Pod has permission to access the DynamoDB table. Access the web store again and navigate to the shopping cart.

```bash
$ kubectl -n ui get service ui-nlb -o jsonpath='{.status.loadBalancer.ingress[*].hostname}{"\n"}'
k8s-ui-uinlb-647e781087-6717c5049aa96bd9.elb.us-west-2.amazonaws.com
$ LB_HOSTNAME=$(kubectl -n ui get service ui-nlb -o jsonpath='{.status.loadBalancer.ingress[*].hostname}{"\n"}')
$ echo "http://$LB_HOSTNAME"
http://k8s-ui-uinlb-647e781087-6717c5049aa96bd9.elb.us-west-2.amazonaws.com
```

The `carts` Pod is able to reach the DynamoDB service and the shopping cart is now accessible!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ sidebar_position: 25
Now, with the `carts` Service Account annotated with the authorized IAM role, the `carts` Pod has permission to access the DynamoDB table. Access the web store again and navigate to the shopping cart.

```bash
$ kubectl get service -n ui ui-nlb -o jsonpath="{.status.loadBalancer.ingress[*].hostname}"
k8s-ui-uinlb-647e781087-6717c5049aa96bd9.elb.us-west-2.amazonaws.com
$ LB_HOSTNAME=$(kubectl -n ui get service ui-nlb -o jsonpath='{.status.loadBalancer.ingress[*].hostname}{"\n"}')
$ echo "http://$LB_HOSTNAME"
http://k8s-ui-uinlb-647e781087-6717c5049aa96bd9.elb.us-west-2.amazonaws.com
```

The `carts` Pod is able to reach the DynamoDB service and the shopping cart is now accessible!
Expand Down
Loading