forked from AdminTurnedDevOps/DevOps-The-Hard-Way-AWS
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Thornton
committed
Mar 25, 2024
1 parent
1d4410d
commit 97b5928
Showing
7 changed files
with
90 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ variable "tags" { | |
} | ||
|
||
variable "deployment_subscription_id" { | ||
default = "1" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
RESOURCE_GROUP='devopsthehardway-rg' | ||
ALB_RESOURCE_NAME='devopsthehardway-alb' | ||
ALB_FRONTEND_NAME='alb-frontend' | ||
|
||
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $ALB_RESOURCE_NAME --query id -o tsv) | ||
|
||
# Create a Gateway | ||
kubectl apply -f - <<EOF | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway-01 | ||
namespace: alb-devopsthehardway | ||
annotations: | ||
alb.networking.azure.io/alb-id: $RESOURCE_ID | ||
spec: | ||
gatewayClassName: azure-alb-external | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
addresses: | ||
- type: alb.networking.azure.io/alb-frontend | ||
value: $ALB_FRONTEND_NAME | ||
EOF | ||
|
||
#Create HTTP Route | ||
kubectl apply -f - <<EOF | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: traffic-uberui | ||
namespace: uber-ui | ||
spec: | ||
parentRefs: | ||
- name: gateway-01 | ||
rules: | ||
- backendRefs: | ||
- name: uber-ui | ||
port: 5000 | ||
EOF | ||
|
||
# kubectl apply -f - <<EOF | ||
# apiVersion: gateway.networking.k8s.io/v1 | ||
# kind: HTTPRoute | ||
# metadata: | ||
# name: traffic-uberui | ||
# namespace: uber-ui | ||
# spec: | ||
# parentRefs: | ||
# - name: gateway-01 | ||
# rules: | ||
# - matches: | ||
# - path: | ||
# type: PathPrefix | ||
# value: / | ||
# - backendRefs: | ||
# - name: uber-ui | ||
# port: 5000 | ||
# EOF |