From b4336d2d8772f3cddf8afb07f9e7b8713dcb362f Mon Sep 17 00:00:00 2001 From: "Woojin Na(Eddie)" Date: Mon, 25 Sep 2023 19:23:18 +0900 Subject: [PATCH] update: add pod identity to workload identity (#203) --- azure/scripts/bootstrap.sh | 60 +++++++++++++++---- .../templates/genesis-job-cleanup.yaml | 6 +- .../templates/genesis-job-init.yaml | 6 +- .../templates/genesis-service-account.yaml | 40 ------------- helm/charts/besu-genesis/values.yaml | 3 +- .../azure-secret-provider-class.yaml | 3 +- .../templates/node-hooks-pre-delete.yaml | 6 +- .../templates/node-hooks-pre-install.yaml | 6 +- .../templates/node-hooks-service-account.yaml | 50 ---------------- .../templates/node-service-account.yaml | 41 ------------- .../besu-node/templates/node-statefulset.yaml | 6 +- helm/charts/besu-node/values.yaml | 3 +- .../templates/genesis-job-cleanup.yaml | 6 +- .../templates/genesis-job-init.yaml | 6 +- .../templates/genesis-service-account.yaml | 40 ------------- .../azure-secret-provider-class.yaml | 3 +- .../templates/node-hooks-pre-delete.yaml | 6 +- .../templates/node-hooks-pre-install.yaml | 6 +- .../templates/node-hooks-service-account.yaml | 48 --------------- .../templates/node-service-account.yaml | 39 ------------ .../templates/node-statefulset.yaml | 6 +- helm/charts/goquorum-node/values.yaml | 3 +- helm/values/bootnode.yml | 3 +- helm/values/genesis-besu.yml | 3 +- helm/values/genesis-goquorum.yml | 3 +- helm/values/reader.yml | 3 +- helm/values/txnode.yml | 3 +- helm/values/validator.yml | 3 +- 28 files changed, 91 insertions(+), 320 deletions(-) delete mode 100644 helm/charts/besu-genesis/templates/genesis-service-account.yaml delete mode 100644 helm/charts/besu-node/templates/node-hooks-service-account.yaml delete mode 100644 helm/charts/besu-node/templates/node-service-account.yaml delete mode 100644 helm/charts/goquorum-genesis/templates/genesis-service-account.yaml delete mode 100644 helm/charts/goquorum-node/templates/node-hooks-service-account.yaml delete mode 100644 helm/charts/goquorum-node/templates/node-service-account.yaml diff --git a/azure/scripts/bootstrap.sh b/azure/scripts/bootstrap.sh index 7ea91710..1660e7f7 100755 --- a/azure/scripts/bootstrap.sh +++ b/azure/scripts/bootstrap.sh @@ -13,6 +13,7 @@ AKS_CLUSTER_NAME=${2:-cluster} AKS_MANAGED_IDENTITY=${3:-identity} # quourum AKS_NAMESPACE=${4:-quorum} +SA_NAME=${5:-quorum} echo "az get-credentials ..." # if running this on a VM/Function/etc use a managed identity @@ -20,19 +21,58 @@ echo "az get-credentials ..." # if running locally az login -# The pod identity cant be done via an ARM template and can only be done via CLI, hence -# https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity -echo "Update the cluster to use pod identity ... " -az aks update --name "$AKS_CLUSTER_NAME" --resource-group "$AKS_RESOURCE_GROUP" --enable-pod-identity +# https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer +echo "Update the cluster to use oidc issuer and workload identity ... " +az aks update -g myResourceGroup -n myAKSCluster --enable-oidc-issuer --enable-workload-identity echo "Provisioning AAD pod-identity... " AKS_MANAGED_IDENTITY_RESOURCE_ID=$(az identity show --name "$AKS_MANAGED_IDENTITY" --resource-group "$AKS_RESOURCE_GROUP" | jq -r '.id') -az aks pod-identity add \ - --resource-group "$AKS_RESOURCE_GROUP" \ - --cluster-name "$AKS_CLUSTER_NAME" \ - --identity-resource-id "$AKS_MANAGED_IDENTITY_RESOURCE_ID" \ - --namespace "$AKS_NAMESPACE" \ - --name quorum-pod-identity >/dev/null +AKS_OIDC_ISSUER=$(az aks show --name "$AKS_MANAGED_IDENTITY" --resource-group "$AKS_RESOURCE_GROUP" --query "oidcIssuerProfile.issuerUrl" -otsv) + +# https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster +cat <