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: Peering name length for long region names. #315

Merged
merged 42 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c53b2e8
Allow communication with API server via udp/1194.
ulkeba Apr 27, 2022
1a1562f
Return IP address instead of res. ID (acc to doc)
ulkeba Apr 27, 2022
391a5e9
Minimal user feedback: echo variables to console.
ulkeba Apr 28, 2022
cdfa294
ifconfig.io to return IPv4 addr for access policy
ulkeba Apr 28, 2022
637567c
Notes for macOS users, having BSD sed.
ulkeba Apr 28, 2022
5849c9d
Improvement to comment.
ulkeba Apr 28, 2022
2f2b4fc
Comment out firewall rule, but add hints.
ulkeba Apr 28, 2022
595e634
Enable FW rule in bicep; remove warning.
ulkeba Apr 28, 2022
a124509
Merge branch 'mspnp:main' into main
ulkeba Apr 30, 2022
0031166
Update references to 'aks-baseline'.
ulkeba Apr 30, 2022
5138d15
Get current branch name and pass as parameter.
ulkeba Apr 30, 2022
9d10690
Pass domain name as parameter to curl container.
ulkeba Apr 30, 2022
2e1e913
Optimize docs for pre-existing AAD group.
ulkeba Apr 30, 2022
6dcfb06
Hint for single-tenant deployment.
ulkeba May 1, 2022
6c76074
Make namespace reader group optional.
ulkeba May 1, 2022
379460e
Fix: Print correct variable name.
ulkeba May 1, 2022
fba516b
Only stage intentionally changed file for commit.
ulkeba May 1, 2022
9234b57
FIx deployment failures on role lookup
ulkeba May 1, 2022
8705e9e
Add some clarification to docs.
ulkeba May 1, 2022
e5ef48a
Make saveenv.sh independent of current directory.
ulkeba May 1, 2022
25d2365
Append suffix to GITOPS variables...
ulkeba May 2, 2022
11214d2
export GITOPS variables.
ulkeba May 2, 2022
3f16ff8
Revert "FIx deployment failures on role lookup"
ulkeba May 2, 2022
150aed4
Merge remote-tracking branch 'mspnp/main' into main
ulkeba May 2, 2022
46297c8
Revert "Only stage intentionally changed file for commit."
ulkeba May 2, 2022
c45f9f9
GITOPS variables are just 'local'.
ulkeba May 2, 2022
27164ef
Update 01-prerequisites.md
ulkeba May 2, 2022
9aac22e
Update 03-aad.md
ulkeba May 2, 2022
ada0835
Update 03-aad.md
ulkeba May 2, 2022
f428e81
Update 03-aad.md
ulkeba May 2, 2022
0a0125f
Update 03-aad.md
ulkeba May 2, 2022
04bae04
Update 11-validation.md
ulkeba May 2, 2022
cbf6c2d
Update 03-aad.md
ulkeba May 2, 2022
881640b
Update 03-aad.md
ulkeba May 2, 2022
2563ded
GITOPS variables are just 'local'.
ulkeba May 2, 2022
9aa9eab
Merge remote-tracking branch 'fork/main' into main
ulkeba May 2, 2022
8c71bb0
Merge branch 'main' of github.com:mspnp/aks-baseline into mspnp-main
ulkeba May 8, 2022
0990481
Merge branch 'mspnp-main' into main
ulkeba May 8, 2022
77e76f2
Fix: Peering name length for long region names.
ulkeba May 8, 2022
46d916d
Update networking/spoke-BU0001A0008.bicep
ulkeba May 10, 2022
f8ca5e4
Change: Replace AppGW WAF config with WAF policy resource. (#316)
ulkeba May 9, 2022
092ba4f
Merge branch 'mspnp:main' into main
ulkeba May 10, 2022
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
Prev Previous commit
Next Next commit
Minimal user feedback: echo variables to console.
  • Loading branch information
ulkeba committed Apr 28, 2022
commit 391a5e954d518a1a69f2063cc31ee648049ca28b
2 changes: 2 additions & 0 deletions 02-ca-certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Now that you have the [prerequisites](./01-prerequisites.md) met, follow the ste

```bash
export APP_GATEWAY_LISTENER_CERTIFICATE_AKS_BASELINE=$(cat appgw.pfx | base64 | tr -d '\n')
echo APP_GATEWAY_LISTENER_CERTIFICATE_AKS_BASELINE: $APP_GATEWAY_LISTENER_CERTIFICATE_AKS_BASELINE
```

1. Generate the wildcard certificate for the AKS Ingress Controller
Expand All @@ -45,6 +46,7 @@ Now that you have the [prerequisites](./01-prerequisites.md) met, follow the ste

```bash
export AKS_INGRESS_CONTROLLER_CERTIFICATE_BASE64_AKS_BASELINE=$(cat traefik-ingress-internal-aks-ingress-tls.crt | base64 | tr -d '\n')
echo AKS_INGRESS_CONTROLLER_CERTIFICATE_BASE64_AKS_BASELINE: $AKS_INGRESS_CONTROLLER_CERTIFICATE_BASE64_AKS_BASELINE
```

### Save your work in-progress
Expand Down
7 changes: 7 additions & 0 deletions 03-aad.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ Following the steps below you will result in an Azure AD configuration that will

```bash
export TENANTID_AZURERBAC_AKS_BASELINE=$(az account show --query tenantId -o tsv)
echo TENANTID_AZURERBAC_AKS_BASELINE: $TENANTID_AZURERBAC_AKS_BASELINE
```

1. Playing the role as the Contoso Bicycle Azure AD team, login into the tenant where Kubernetes Cluster API authorization will be associated with.

```bash
az login -t <Replace-With-ClusterApi-AzureAD-TenantId> --allow-no-subscriptions
export TENANTID_K8SRBAC_AKS_BASELINE=$(az account show --query tenantId -o tsv)
echo TENANTID_K8SRBAC_AKS_BASELINE: $TENANTID_K8SRBAC_AKS_BASELINE
```

1. Create/identify the Azure AD security group that is going to map to the [Kubernetes Cluster Admin](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles) role `cluster-admin`.
Expand All @@ -37,6 +39,7 @@ Following the steps below you will result in an Azure AD configuration that will

```bash
export AADOBJECTID_GROUP_CLUSTERADMIN_AKS_BASELINE=$(az ad group create --display-name 'cluster-admins-bu0001a000800' --mail-nickname 'cluster-admins-bu0001a000800' --description "Principals in this group are cluster admins in the bu0001a000800 cluster." --query objectId -o tsv)
echo AADOBJECTID_GROUP_CLUSTERADMIN_AKS_BASELINE: $AADOBJECTID_GROUP_CLUSTERADMIN_AKS_BASELINE
```

This Azure AD group object ID will be used later while creating the cluster. This way, once the cluster gets deployed the new group will get the proper Cluster Role bindings in Kubernetes.
Expand All @@ -49,6 +52,9 @@ Following the steps below you will result in an Azure AD configuration that will
TENANTDOMAIN_K8SRBAC=$(az ad signed-in-user show --query 'userPrincipalName' -o tsv | cut -d '@' -f 2 | sed 's/\"//')
AADOBJECTNAME_USER_CLUSTERADMIN=bu0001a000800-admin
AADOBJECTID_USER_CLUSTERADMIN=$(az ad user create --display-name=${AADOBJECTNAME_USER_CLUSTERADMIN} --user-principal-name ${AADOBJECTNAME_USER_CLUSTERADMIN}@${TENANTDOMAIN_K8SRBAC} --force-change-password-next-login --password ChangeMebu0001a0008AdminChangeMe --query objectId -o tsv)
echo TENANTDOMAIN_K8SRBAC: $TENANTDOMAIN_K8SRBAC
echo AADOBJECTNAME_USER_CLUSTERADMIN: $AADOBJECTNAME_USER_CLUSTERADMIN
echo AADOBJECTID_USER_CLUSTERADMIN: $AADOBJECTID_USER_CLUSTERADMIN
```

1. Add the cluster admin user(s) to the cluster admin security group.
Expand All @@ -63,6 +69,7 @@ Following the steps below you will result in an Azure AD configuration that will

```bash
export AADOBJECTID_GROUP_A0008_READER_AKS_BASELINE=$(az ad group create --display-name 'cluster-ns-a0008-readers-bu0001a000800' --mail-nickname 'cluster-ns-a0008-readers-bu0001a000800' --description "Principals in this group are readers of namespace a0008 in the bu0001a000800 cluster." --query objectId -o tsv)
echo AADOBJECTID_GROUP_A0008_READER_AKS_BASELINE: $AADOBJECTID_GROUP_A0008_READER_AKS_BASELINE
```

## Kubernetes RBAC backing store
Expand Down
2 changes: 2 additions & 0 deletions 04-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The following two resource groups will be created and populated with networking

```bash
RESOURCEID_VNET_HUB=$(az deployment group show -g rg-enterprise-networking-hubs -n hub-default --query properties.outputs.hubVnetId.value -o tsv)
echo RESOURCEID_VNET_HUB: $RESOURCEID_VNET_HUB

# [This takes about four minutes to run.]
az deployment group create -g rg-enterprise-networking-spokes -f networking/spoke-BU0001A0008.bicep -p location=eastus2 hubVnetResourceId="${RESOURCEID_VNET_HUB}"
Expand All @@ -93,6 +94,7 @@ The following two resource groups will be created and populated with networking

```bash
RESOURCEID_SUBNET_NODEPOOLS=$(az deployment group show -g rg-enterprise-networking-spokes -n spoke-BU0001A0008 --query properties.outputs.nodepoolSubnetResourceIds.value -o json)
echo RESOURCEID_VNET_HUB: $RESOURCEID_SUBNET_NODEPOOLS

# [This takes about ten minutes to run.]
az deployment group create -g rg-enterprise-networking-hubs -f networking/hub-regionA.bicep -p location=eastus2 nodepoolSubnetResourceIds="${RESOURCEID_SUBNET_NODEPOOLS}"
Expand Down
2 changes: 2 additions & 0 deletions 05-bootstrap-prep.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ We'll be bootstrapping this cluster with the Flux GitOps agent as installed as a

```bash
export RESOURCEID_VNET_CLUSTERSPOKE_AKS_BASELINE=$(az deployment group show -g rg-enterprise-networking-spokes -n spoke-BU0001A0008 --query properties.outputs.clusterVnetResourceId.value -o tsv)
echo RESOURCEID_VNET_CLUSTERSPOKE_AKS_BASELINE: $RESOURCEID_VNET_CLUSTERSPOKE_AKS_BASELINE
```

1. Deploy the container registry template.
Expand All @@ -51,6 +52,7 @@ We'll be bootstrapping this cluster with the Flux GitOps agent as installed as a
```bash
# Get your ACR instance name
export ACR_NAME_AKS_BASELINE=$(az deployment group show -g rg-bu0001a0008 -n acr-stamp --query properties.outputs.containerRegistryName.value -o tsv)
echo ACR_NAME_AKS_BASELINE: $ACR_NAME_AKS_BASELINE

# Import core image(s) hosted in public container registries to be used during bootstrapping
az acr import --source docker.io/weaveworks/kured:1.9.0 -n $ACR_NAME_AKS_BASELINE
Expand Down
2 changes: 2 additions & 0 deletions 06-aks-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Now that your [ACR instance is deployed and ready to support cluster bootstrappi

```bash
GITOPS_REPOURL=$(git config --get remote.origin.url)
echo GITOPS_REPOURL: $GITOPS_REPOURL
```

1. Deploy the cluster ARM template.
Expand All @@ -36,6 +37,7 @@ Now that your [ACR instance is deployed and ready to support cluster bootstrappi
# Federated Identity, see https://github.com/Azure/login#configure-deployment-credentials.
az ad sp create-for-rbac --name "github-workflow-aks-cluster" --sdk-auth --skip-assignment > sp.json
export APP_ID=$(grep -oP '(?<="clientId": ").*?[^\\](?=",)' sp.json)
echo APP_ID: $APP_ID

# Wait for propagation
until az ad sp show --id ${APP_ID} &> /dev/null ; do echo "Waiting for Azure AD propagation" && sleep 5; done
Expand Down
1 change: 1 addition & 0 deletions 07-bootstrap-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GitOps allows a team to author Kubernetes manifest files, persist them in their

```bash
AKS_CLUSTER_NAME=$(az aks list -g rg-bu0001a0008 --query '[0].name' -o tsv)
echo AKS_CLUSTER_NAME: $AKS_CLUSTER_NAME
```

1. Get AKS `kubectl` credentials.
Expand Down
3 changes: 3 additions & 0 deletions 08-workload-prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ The AKS Cluster has been [bootstrapped](./07-bootstrap-validation.md), wrapping

```bash
export KEYVAULT_NAME_AKS_BASELINE=$(az deployment group show --resource-group rg-bu0001a0008 -n cluster-stamp --query properties.outputs.keyVaultName.value -o tsv)
echo KEYVAULT_NAME_AKS_BASELINE: $KEYVAULT_NAME_AKS_BASELINE
TEMP_ROLEASSIGNMENT_TO_UPLOAD_CERT=$(az role assignment create --role a4417e6f-fecd-4de8-b567-7b0420556985 --assignee-principal-type user --assignee-object-id $(az ad signed-in-user show --query 'objectId' -o tsv) --scope $(az keyvault show --name $KEYVAULT_NAME_AKS_BASELINE --query 'id' -o tsv) --query 'id' -o tsv)
echo TEMP_ROLEASSIGNMENT_TO_UPLOAD_CERT: $TEMP_ROLEASSIGNMENT_TO_UPLOAD_CERT

# If you are behind a proxy or some other egress that does not provide a consistent IP, you'll need to manually adjust the
# Azure Key Vault firewall to allow this traffic.
CURRENT_IP_ADDRESS=$(curl -s https://ifconfig.io)
echo CURRENT_IP_ADDRESS: $CURRENT_IP_ADDRESS
az keyvault network-rule add -n $KEYVAULT_NAME_AKS_BASELINE --ip-address ${CURRENT_IP_ADDRESS}
```

Expand Down
2 changes: 2 additions & 0 deletions 09-secret-management-and-ingress-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Previously you have configured [workload prerequisites](./08-workload-prerequisi
```bash
TRAEFIK_USER_ASSIGNED_IDENTITY_RESOURCE_ID=$(az deployment group show --resource-group rg-bu0001a0008 -n cluster-stamp --query properties.outputs.aksIngressControllerPodManagedIdentityResourceId.value -o tsv)
TRAEFIK_USER_ASSIGNED_IDENTITY_CLIENT_ID=$(az deployment group show --resource-group rg-bu0001a0008 -n cluster-stamp --query properties.outputs.aksIngressControllerPodManagedIdentityClientId.value -o tsv)
echo TRAEFIK_USER_ASSIGNED_IDENTITY_RESOURCE_ID: $TRAEFIK_USER_ASSIGNED_IDENTITY_RESOURCE_ID
echo TRAEFIK_USER_ASSIGNED_IDENTITY_CLIENT_ID: $TRAEFIK_USER_ASSIGNED_IDENTITY_CLIENT_ID
```

1. Ensure your bootstrapping process has created the following namespace.
Expand Down
1 change: 1 addition & 0 deletions 11-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This section will help you to validate the workload is exposed correctly and res
```bash
# query the Azure Application Gateway Public Ip
APPGW_PUBLIC_IP=$(az deployment group show --resource-group rg-enterprise-networking-spokes -n spoke-BU0001A0008 --query properties.outputs.appGwPublicIpAddress.value -o tsv)
echo APPGW_PUBLIC_IP: $APPGW_PUBLIC_IP
```

1. Create `A` Record for DNS
Expand Down