Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Thornton committed Mar 25, 2024
1 parent f83f1eb commit 166f681
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Terraform-AZURE-Services-Creation/AKS/rbac.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ data "azurerm_subscriptions" "thomasthorntoncloud" {
resource "azurerm_role_assignment" "appgwcontainerfix" {
principal_id = azurerm_user_assigned_identity.alb_identity.principal_id
scope = data.azurerm_subscriptions.thomasthorntoncloud.subscriptions[0].id
role_definition_name = "contributor"
role_definition_name = "Network Contributor"
depends_on = [
azurerm_kubernetes_cluster.k8s,
azurerm_user_assigned_identity.alb_identity
Expand Down
52 changes: 25 additions & 27 deletions kubernetes_manifest/script/alb-controller-install-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,36 @@

RESOURCE_GROUP="devopsthehardway-rg"
AKS_NAME="devopsthehardwayaks"
helm_resource_namespace="alb"
helm_resource_namespace="azure-alb-system"
VNET_NAME="devopsthehardway-vnet"
ALB_SUBNET_NAME="appgw"

# create namespace
# kubectl create namespace $helm_resource_namespace
create namespace
kubectl create namespace $helm_resource_namespace

# # az aks get-credentials --resource-group $RESOURCE_GROUP --name $AKS_NAME
# helm install alb-controller oci://mcr.microsoft.com/application-lb/charts/alb-controller \
# --namespace $helm_resource_namespace \
# --version 1.0.0 \
# --set albController.namespace=$helm_resource_namespace \
# --set albController.podIdentity.clientID=$(az identity show -g $RESOURCE_GROUP -n azure-alb-identity --query clientId -o tsv)
# az aks get-credentials --resource-group $RESOURCE_GROUP --name $AKS_NAME
helm install alb-controller oci://mcr.microsoft.com/application-lb/charts/alb-controller \
--version 1.0.0 \
--set albController.podIdentity.clientID=$(az identity show -g $RESOURCE_GROUP -n azure-alb-identity --query clientId -o tsv)


ALB_SUBNET_ID=$(az network vnet subnet show --name $ALB_SUBNET_NAME --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --query '[id]' --output tsv)
# ALB_SUBNET_ID=$(az network vnet subnet show --name $ALB_SUBNET_NAME --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --query '[id]' --output tsv)

# Creates the namespace for alb-controller
kubectl apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: alb-infra
EOF
# # Creates the namespace for alb-controller
# kubectl apply -f - <<EOF
# apiVersion: v1
# kind: Namespace
# metadata:
# name: alb-infra
# EOF

kubectl apply -f - <<EOF
apiVersion: alb.networking.azure.io/v1
kind: ApplicationLoadBalancer
metadata:
name: alb-devopshardway
namespace: alb-infra
spec:
associations:
- $ALB_SUBNET_ID
EOF
# kubectl apply -f - <<EOF
# apiVersion: alb.networking.azure.io/v1
# kind: ApplicationLoadBalancer
# metadata:
# name: alb-devopshardway
# namespace: alb-infra
# spec:
# associations:
# - $ALB_SUBNET_ID
# EOF

0 comments on commit 166f681

Please sign in to comment.