You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cloud_experts_tutorials/cloud-experts-using-alb-and-waf.adoc
+57-37Lines changed: 57 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -21,24 +21,21 @@ AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS r
21
21
22
22
You can use an AWS Application Load Balancer (ALB) to add a Web Application Firewall (WAF) to your {product-title} (ROSA) workloads. Using an external solution protects ROSA resources from experiencing denial of service due to handling the WAF.
23
23
24
-
[NOTE]
24
+
[IMPORTANT]
25
25
====
26
-
It is recommended that you use the xref:../cloud_experts_tutorials/cloud-experts-using-cloudfront-and-waf.adoc#cloud-experts-using-cloudfront-and-waf[CloudFront method] unless you absolutely must use an ALB based solution.
26
+
It is recommended that you use the more flexible xref:../cloud_experts_tutorials/cloud-experts-using-cloudfront-and-waf.adoc#cloud-experts-using-cloudfront-and-waf[CloudFront method] unless you absolutely must use an ALB based solution.
27
27
====
28
28
29
-
//[Here](https://iamondemand.com/blog/elb-vs-alb-vs-nlb-choosing-the-best-aws-load-balancer-for-your-needs/)'s a good overview of AWS LB types and what they support
30
-
31
-
// Loosely based off EKS instructions here - https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-aws-waf/
32
-
33
29
[id="prerequisites_{context}"]
34
30
== Prerequisites
35
31
32
+
* Multiple availability zone (AZ) ROSA (HCP or Classic) cluster.
33
+
+
36
34
[NOTE]
37
35
====
38
-
AWS ALBs require a multi-AZ cluster, as well as three public subnets split across three AZs in the same VPC as the cluster.
36
+
AWS ALBs require at least two _public_ subnets across AZs, link:https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#availability-zones[per the AWS documentation]. For this reason, only multiple AZ ROSA clusters can be used with ALBs.
39
37
====
40
-
41
-
* xref:../rosa_install_access_delete_clusters/rosa-sts-creating-a-cluster-quickly.adoc#rosa-sts-creating-a-cluster-quickly[A multi-AZ ROSA Classic cluster].
38
+
+
42
39
* You have access to the OpenShift CLI (`oc`).
43
40
* You have access to the AWS CLI (`aws`).
44
41
@@ -50,13 +47,13 @@ AWS ALBs require a multi-AZ cluster, as well as three public subnets split acros
50
47
[source,terminal]
51
48
----
52
49
$ export AWS_PAGER=""
53
-
$ export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}" | sed 's/-[a-z0-9]\{5\}$//')
50
+
$ export CLUSTER=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}")
54
51
$ export REGION=$(oc get infrastructure cluster -o=jsonpath="{.status.platformStatus.aws.region}")
55
52
$ export OIDC_ENDPOINT=$(oc get authentication.config.openshift.io cluster -o jsonpath='{.spec.serviceAccountIssuer}' | sed 's|^https://||')
<1> Replace with the VPC ID of the cluster, for example: `export VPC_ID=vpc-04c429b7dbc4680ba`.
76
+
<2> Replace with a space-separated list of the private subnet IDs of the cluster, making sure to preserve the `()`. For example: `export PUBLIC_SUBNET_IDS=(subnet-056fd6861ad332ba2 subnet-08ce3b4ec753fe74c subnet-071aa28228664972f)`.
77
+
<3> Replace with a space-separated list of the private subnet IDs of the cluster, making sure to preserve the `()`. For example: `export PRIVATE_SUBNET_IDS=(subnet-0b933d72a8d72c36a subnet-0817eb72070f1d3c2 subnet-0806e64159b66665a)`.
78
78
+
79
-
. Add a tag to your cluster's VPC with the cluster name:
79
+
. Add a tag to your cluster's VPC with the cluster identifier:
The link:https://github.com/openshift/aws-load-balancer-operator[AWS Load Balancer Operator] is used to used to install, manage and configure an instance of `aws-load-balancer-controller` in a ROSA cluster. To deploy ALBs in ROSA, we need to first deploy the AWS Load Balancer Operator.
110
113
111
-
. Create an AWS IAM policy for the AWS Load Balancer Controller:
114
+
. Create a new project to deploy the AWS Load Balancer Operator into by running the following command:
115
+
+
116
+
[source,terminal]
117
+
----
118
+
$ oc new-project aws-load-balancer-operator
119
+
----
120
+
+
121
+
. Create an AWS IAM policy for the AWS Load Balancer Controller if one does not already exist by running the following command:
112
122
+
113
123
[NOTE]
114
124
====
115
-
The policy is sourced from link:https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.4/docs/install/iam_policy.json[the upstream AWS Load Balancer Controller policy] plus permission to create tags on subnets. This is required by the operator to function.
125
+
The policy is sourced from link:https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json[the upstream AWS Load Balancer Controller policy]. This is required by the operator to function.
@@ -433,11 +449,15 @@ $ curl -X POST "http://${INGRESS}" \
433
449
</html
434
450
----
435
451
+
452
+
[NOTE]
453
+
====
454
+
Activation of the AWS WAF integration can sometimes take several minutes. If you do not receive a `403 Forbidden` error, please wait a few seconds and try again.
455
+
====
456
+
+
436
457
The expected result is a `403 Forbidden` error, which means the AWS WAF is protecting your application.
437
458
438
459
[role="_additional-resources"]
439
460
[id="additional-resources_{context}"]
440
461
== Additional resources
441
462
442
-
* link:https://docs.openshift.com/rosa/applications/deployments/osd-config-custom-domains-applications.html[Custom domains for applications] in the Red{nbsp}Hat documentation
443
463
* link:https://youtu.be/-HorEsl2ho4[Adding Extra Security with AWS WAF, CloudFront and ROSA | Amazon Web Services] on YouTube
0 commit comments