Skip to content

Commit bab1915

Browse files
committed
CI: workload-identity native
Signed-off-by: Jack Francis <[email protected]>
1 parent 753edfb commit bab1915

File tree

60 files changed

+342
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+342
-305
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,10 @@ release-*/manifests/calico-*.yaml
8686
# mentioned in the capz book
8787
/sp.json
8888
/cluster.yaml
89+
90+
# CI workload-identity
91+
jwks.json
92+
*.pub
93+
*.key
94+
azure_identity_id
95+
openid-configuration.json

Makefile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ KUSTOMIZE_VER := v5.4.1
8989
KUSTOMIZE_BIN := kustomize
9090
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
9191

92+
AZWI_VER := v1.2.2
93+
AZWI_BIN := azwi
94+
AZWI := $(TOOLS_BIN_DIR)/$(AZWI_BIN)-$(AZWI_VER)
95+
9296
MOCKGEN_VER := v0.4.0
9397
MOCKGEN_BIN := mockgen
9498
MOCKGEN := $(TOOLS_BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER)
@@ -187,6 +191,12 @@ LDFLAGS := $(shell hack/version.sh)
187191
CLUSTER_TEMPLATE ?= cluster-template.yaml
188192

189193
export KIND_CLUSTER_NAME ?= capz
194+
RANDOM_SUFFIX := $(shell /bin/bash -c "echo $$RANDOM")
195+
export AZWI_RESOURCE_GROUP ?= capz-wi-$(RANDOM_SUFFIX)
196+
export CI_RG ?= $(AZWI_RESOURCE_GROUP)
197+
export USER_IDENTITY ?= $(addsuffix $(RANDOM_SUFFIX),$(CI_RG))
198+
export AZWI_LOCATION ?= eastus
199+
export AZURE_IDENTITY_ID_FILEPATH ?= $(ROOT_DIR)/azure_identity_id
190200

191201
## --------------------------------------
192202
## Binaries
@@ -283,7 +293,7 @@ verify-codespell: codespell ## Verify codespell.
283293
##@ Development:
284294

285295
.PHONY: install-tools # populate hack/tools/bin
286-
install-tools: $(ENVSUBST) $(KUSTOMIZE) $(KUBECTL) $(HELM) $(GINKGO) $(KIND)
296+
install-tools: $(ENVSUBST) $(KUSTOMIZE) $(KUBECTL) $(HELM) $(GINKGO) $(KIND) $(AZWI)
287297

288298
.PHONY: create-management-cluster
289299
create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create a management cluster.
@@ -293,9 +303,6 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
293303
# Install cert manager and wait for availability
294304
./hack/install-cert-manager.sh
295305

296-
# Create secret for AzureClusterIdentity
297-
./hack/create-identity-secret.sh
298-
299306
# Create customized cloud provider configs
300307
./hack/create-custom-cloud-provider-config.sh
301308

@@ -337,7 +344,8 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
337344
.PHONY: create-workload-cluster
338345
create-workload-cluster: $(ENVSUBST) $(KUBECTL) ## Create a workload cluster.
339346
# Create workload Cluster.
340-
@if [ -f "$(TEMPLATES_DIR)/$(CLUSTER_TEMPLATE)" ]; then \
347+
@export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$(shell cat $(AZURE_IDENTITY_ID_FILEPATH)); \
348+
if [ -f "$(TEMPLATES_DIR)/$(CLUSTER_TEMPLATE)" ]; then \
341349
timeout --foreground 300 bash -c "until $(ENVSUBST) < $(TEMPLATES_DIR)/$(CLUSTER_TEMPLATE) | $(KUBECTL) apply -f -; do sleep 5; done"; \
342350
elif [ -f "$(CLUSTER_TEMPLATE)" ]; then \
343351
timeout --foreground 300 bash -c "until $(ENVSUBST) < "$(CLUSTER_TEMPLATE)" | $(KUBECTL) apply -f -; do sleep 5; done"; \
@@ -682,7 +690,11 @@ test-cover: test ## Run tests with code coverage and generate reports.
682690

683691
.PHONY: kind-create-bootstrap
684692
kind-create-bootstrap: $(KUBECTL) ## Create capz kind bootstrap cluster.
685-
export AZWI=$${AZWI:-true} KIND_CLUSTER_NAME=capz-e2e && ./scripts/kind-with-registry.sh
693+
KIND_CLUSTER_NAME=capz-e2e && ./scripts/kind-with-registry.sh
694+
695+
.PHONY: cleanup-workload-identity
696+
cleanup-workload-identity: ## Cleanup CI workload-identity infra
697+
./scripts/cleanup-workload-identity.sh
686698

687699
## --------------------------------------
688700
## Security Scanning
@@ -788,6 +800,16 @@ $(HELM): ## Put helm into tools folder.
788800
ln -sf $(HELM) $(TOOLS_BIN_DIR)/$(HELM_BIN)
789801
rm -f $(TOOLS_BIN_DIR)/get_helm.sh
790802

803+
$(AZWI): ## Put azwi into tools folder.
804+
mkdir -p $(TOOLS_BIN_DIR)
805+
rm -f "$(TOOLS_BIN_DIR)/$(AZWI_BIN)*"
806+
curl --retry $(CURL_RETRIES) -fsSL -o $(TOOLS_BIN_DIR)/azwi.tar.gz https://github.com/Azure/azure-workload-identity/releases/download/$(AZWI_VER)/azwi-$(AZWI_VER)-$(GOOS)-$(GOARCH).tar.gz
807+
tar -xf "$(TOOLS_BIN_DIR)/azwi.tar.gz" -C $(TOOLS_BIN_DIR) $(AZWI_BIN)
808+
mv "$(TOOLS_BIN_DIR)/$(AZWI_BIN)" $(AZWI)
809+
ln -sf $(AZWI) $(TOOLS_BIN_DIR)/$(AZWI_BIN)
810+
chmod +x $(AZWI) $(TOOLS_BIN_DIR)/$(AZWI_BIN)
811+
rm -f $(TOOLS_BIN_DIR)/azwi.tar.gz
812+
791813
$(KIND): ## Build kind into tools folder.
792814
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/kind $(KIND_BIN) $(KIND_VER)
793815

config/capz/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: gcr.io/k8s-staging-cluster-api-azure/cluster-api-azure-controller:main
11+
- image: franciscapzacr.azurecr.io/cluster-api-azure-controller-amd64:dev
1212
name: manager

config/capz/manager_pull_policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spec:
88
spec:
99
containers:
1010
- name: manager
11-
imagePullPolicy: Always
11+
imagePullPolicy: IfNotPresent

e2e.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
# long-running E2E jobs every time that file changes
55

66
##@ E2E Testing:
7-
87
.PHONY: test-e2e-run
98
test-e2e-run: generate-e2e-templates install-tools kind-create-bootstrap ## Run e2e tests.
109
$(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST) && \
11-
$(GINKGO) -v --trace --timeout=4h --tags=e2e --focus="$(GINKGO_FOCUS)" --skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) --output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) ./test/e2e -- \
10+
export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$(shell cat $(AZURE_IDENTITY_ID_FILEPATH)); \
11+
$(GINKGO) -v --trace --timeout=4h --tags=e2e --focus="$(GINKGO_FOCUS)" --skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) --output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) ./test/e2e -- \
1212
-e2e.artifacts-folder="$(ARTIFACTS)" \
1313
-e2e.config="$(E2E_CONF_FILE_ENVSUBST)" \
1414
-e2e.skip-log-collection="$(SKIP_LOG_COLLECTION)" \
1515
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) $(E2E_ARGS)
1616
$(MAKE) clean-release-git
17+
$(MAKE) cleanup-workload-identity
1718

1819
.PHONY: test-e2e
1920
test-e2e: ## Run "docker-build" and "docker-push" rules then run e2e tests.

hack/create-dev-cluster.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ export AZURE_VNET_NAME=${CLUSTER_NAME}-vnet
3838
export AZURE_LOCATION="${AZURE_LOCATION:-southcentralus}"
3939
export AZURE_RESOURCE_GROUP=${CLUSTER_NAME}
4040

41-
AZURE_SUBSCRIPTION_ID_B64="$(echo -n "$AZURE_SUBSCRIPTION_ID" | base64 | tr -d '\n')"
42-
AZURE_TENANT_ID_B64="$(echo -n "$AZURE_TENANT_ID" | base64 | tr -d '\n')"
43-
AZURE_CLIENT_ID_B64="$(echo -n "$AZURE_CLIENT_ID" | base64 | tr -d '\n')"
44-
AZURE_CLIENT_SECRET_B64="$(echo -n "$AZURE_CLIENT_SECRET" | base64 | tr -d '\n')"
45-
46-
export AZURE_SUBSCRIPTION_ID_B64 AZURE_TENANT_ID_B64 AZURE_CLIENT_ID_B64 AZURE_CLIENT_SECRET_B64
47-
4841
# Machine settings.
4942
export CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-3}
5043
export AZURE_CONTROL_PLANE_MACHINE_TYPE="${CONTROL_PLANE_MACHINE_TYPE:-Standard_B2s}"

hack/util.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,4 @@ capz::util::generate_ssh_key() {
108108
capz::util::ensure_azure_envs() {
109109
: "${AZURE_SUBSCRIPTION_ID:?Environment variable empty or not defined.}"
110110
: "${AZURE_TENANT_ID:?Environment variable empty or not defined.}"
111-
: "${AZURE_CLIENT_ID:?Environment variable empty or not defined.}"
112-
: "${AZURE_CLIENT_SECRET:?Environment variable empty or not defined.}"
113111
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
# Install kubectl and kind
21+
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
22+
# shellcheck source=hack/ensure-azcli.sh
23+
source "${REPO_ROOT}/hack/ensure-azcli.sh"
24+
25+
AZWI_RESOURCE_GROUP="${AZWI_RESOURCE_GROUP:-}"
26+
27+
if [[ -z "${AZWI_RESOURCE_GROUP}" ]]; then
28+
echo AZWI_RESOURCE_GROUP environment variable must be set
29+
exit 1
30+
fi
31+
32+
echo "Cleaning up CI workload-identity infra..."
33+
az group delete --no-wait -y -n "${AZWI_RESOURCE_GROUP}"

scripts/kind-with-registry.sh

Lines changed: 96 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ set -o pipefail
1919

2020
# Install kubectl and kind
2121
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
22+
# shellcheck source=hack/ensure-azcli.sh
23+
source "${REPO_ROOT}/hack/ensure-azcli.sh"
24+
2225
KUBECTL="${REPO_ROOT}/hack/tools/bin/kubectl"
2326
KIND="${REPO_ROOT}/hack/tools/bin/kind"
24-
AZWI_ENABLED=${AZWI:-}
27+
AZWI="${REPO_ROOT}/hack/tools/bin/azwi"
28+
AZWI_ENABLED=${AZWI_ENABLED:-true}
29+
RAND_SUFFIX=$(openssl rand -hex 4)
30+
export AZWI_STORAGE_ACCOUNT="oidcissuer${RAND_SUFFIX}"
31+
export AZWI_STORAGE_CONTAINER="oidc"
32+
export SERVICE_ACCOUNT_ISSUER=${SERVICE_ACCOUNT_ISSUER:-}
33+
export SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH=${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH:-}
34+
export SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH=${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH:-}
2535
make --directory="${REPO_ROOT}" "${KUBECTL##*/}" "${KIND##*/}"
2636

2737
# Export desired cluster name; default is "capz"
@@ -44,35 +54,105 @@ fi
4454

4555
# To use workload identity, service account signing key pairs base64 encoded should be exposed via the
4656
# env variables. The function creates the key pair files after reading it from the env variables.
57+
# TODO we need to document that these env vars are a new requirement
4758
function checkAZWIENVPreReqsAndCreateFiles() {
48-
if [[ -z "${SERVICE_ACCOUNT_SIGNING_PUB}" ]]; then
49-
echo "'SERVICE_ACCOUNT_SIGNING_PUB' is not set."
50-
exit 1
59+
unset AZURE_STORAGE_KEY
60+
unset AZURE_STORAGE_ACCOUNT
61+
# check if user is logged into azure cli
62+
if ! az account show > /dev/null 2>&1; then
63+
echo "Please login to Azure CLI using 'az login'"
64+
exit 1
5165
fi
5266

53-
if [[ -z "${SERVICE_ACCOUNT_SIGNING_KEY}" ]]; then
54-
echo "'SERVICE_ACCOUNT_SIGNING_KEY' is not set."
55-
exit 1
67+
if [ "$(az group exists --name "${AZWI_RESOURCE_GROUP}" --output tsv)" == 'false' ]; then
68+
echo "Creating resource group '${AZWI_RESOURCE_GROUP}' in '${AZWI_LOCATION}'"
69+
az group create --name "${AZWI_RESOURCE_GROUP}" --location "${AZWI_LOCATION}" --output none --only-show-errors
70+
fi
71+
if ! az storage account show --name "${AZWI_STORAGE_ACCOUNT}" --resource-group "${AZWI_RESOURCE_GROUP}" > /dev/null 2>&1; then
72+
echo "Creating storage account '${AZWI_STORAGE_ACCOUNT}' in '${AZWI_RESOURCE_GROUP}'"
73+
az storage account create --resource-group "${AZWI_RESOURCE_GROUP}" --name "${AZWI_STORAGE_ACCOUNT}" --allow-blob-public-access true --output none --only-show-errors
74+
fi
75+
if ! az storage container show --name "${AZWI_STORAGE_CONTAINER}" --account-name "${AZWI_STORAGE_ACCOUNT}" > /dev/null 2>&1; then
76+
echo "Creating storage container '${AZWI_STORAGE_CONTAINER}' in '${AZWI_STORAGE_ACCOUNT}'"
77+
az storage container create --name "${AZWI_STORAGE_CONTAINER}" --account-name "${AZWI_STORAGE_ACCOUNT}" --public-access blob --output none --only-show-errors
78+
fi
79+
export SERVICE_ACCOUNT_ISSUER="https://${AZWI_STORAGE_ACCOUNT}.blob.core.windows.net/${AZWI_STORAGE_CONTAINER}/"
80+
AZWI_OPENID_CONFIG_FILEPATH="${REPO_ROOT}/openid-configuration.json"
81+
cat <<EOF > "${AZWI_OPENID_CONFIG_FILEPATH}"
82+
{
83+
"issuer": "${SERVICE_ACCOUNT_ISSUER}",
84+
"jwks_uri": "${SERVICE_ACCOUNT_ISSUER}openid/v1/jwks",
85+
"response_types_supported": [
86+
"id_token"
87+
],
88+
"subject_types_supported": [
89+
"public"
90+
],
91+
"id_token_signing_alg_values_supported": [
92+
"RS256"
93+
]
94+
}
95+
EOF
96+
if [[ -z "${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}" ]]; then
97+
export SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH="${REPO_ROOT}/capz-wi-sa.pub"
98+
fi
99+
if [[ -z "${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}" ]]; then
100+
export SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH="${REPO_ROOT}/capz-wi-sa.key"
56101
fi
57-
mkdir -p "$HOME"/azwi/creds
58-
echo "${SERVICE_ACCOUNT_SIGNING_PUB}" > "$HOME"/azwi/creds/sa.pub
59-
echo "${SERVICE_ACCOUNT_SIGNING_KEY}" > "$HOME"/azwi/creds/sa.key
60-
SERVICE_ACCOUNT_ISSUER="${SERVICE_ACCOUNT_ISSUER:-https://oidcissuercapzci.blob.core.windows.net/oidc-capzci/}"
102+
openssl genrsa -out "${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}" 2048
103+
openssl rsa -in "${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}" -pubout -out "${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}"
104+
AZWI_JWKS_JSON_FILEPATH="${REPO_ROOT}/jwks.json"
105+
"${AZWI}" jwks --public-keys "${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}" --output-file "${AZWI_JWKS_JSON_FILEPATH}"
106+
echo "Uploading openid-configuration document to '${AZWI_STORAGE_ACCOUNT}' storage account"
107+
upload_to_blob "${AZWI_STORAGE_CONTAINER}" "${AZWI_OPENID_CONFIG_FILEPATH}" ".well-known/openid-configuration"
108+
echo "Uploading jwks document to '${AZWI_STORAGE_ACCOUNT}' storage account"
109+
upload_to_blob "${AZWI_STORAGE_CONTAINER}" "${AZWI_JWKS_JSON_FILEPATH}" "openid/v1/jwks"
110+
az identity create -n "${USER_IDENTITY}" -g "${AZWI_RESOURCE_GROUP}" -l "${AZWI_LOCATION}" --output none --only-show-errors
111+
AZURE_IDENTITY_ID=$(az identity show -n "${USER_IDENTITY}" -g "${AZWI_RESOURCE_GROUP}" --query clientId -o tsv)
112+
AZURE_IDENTITY_ID_PRINCIPAL_ID=$(az identity show -n "${USER_IDENTITY}" -g "${AZWI_RESOURCE_GROUP}" --query principalId -o tsv)
113+
echo "${AZURE_IDENTITY_ID}" > "${AZURE_IDENTITY_ID_FILEPATH}"
114+
until az role assignment create --assignee-object-id "${AZURE_IDENTITY_ID_PRINCIPAL_ID}" --role "Contributor" --scope "/subscriptions/${AZURE_SUBSCRIPTION_ID}" --assignee-principal-type ServicePrincipal --output none --only-show-errors; do
115+
sleep 5
116+
done
117+
az identity federated-credential create -n "capz-federated-identity" \
118+
--identity-name "${USER_IDENTITY}" \
119+
-g "${AZWI_RESOURCE_GROUP}" \
120+
--issuer "${SERVICE_ACCOUNT_ISSUER}" \
121+
--subject "system:serviceaccount:capz-system:capz-manager" --output none --only-show-errors
122+
az identity federated-credential create -n "aso-federated-identity" \
123+
--identity-name "${USER_IDENTITY}" \
124+
-g "${AZWI_RESOURCE_GROUP}" \
125+
--issuer "${SERVICE_ACCOUNT_ISSUER}" \
126+
--subject "system:serviceaccount:capz-system:azureserviceoperator-default" --output none --only-show-errors
127+
}
128+
129+
function upload_to_blob() {
130+
local container_name=$1
131+
local file_path=$2
132+
local blob_name=$3
133+
134+
echo "Uploading ${file_path} to '${AZWI_STORAGE_ACCOUNT}' storage account"
135+
az storage blob upload \
136+
--container-name "${container_name}" \
137+
--file "${file_path}" \
138+
--name "${blob_name}" \
139+
--account-name "${AZWI_STORAGE_ACCOUNT}" \
140+
--output none --only-show-errors
61141
}
62142

63143
# This function create a kind cluster for Workload identity which requires key pairs path
64144
# to be mounted on the kind cluster and hence extra mount flags are required.
65145
function createKindForAZWI() {
66-
echo "creating azwi kind"
146+
echo "creating workload-identity-enabled kind configuration"
67147
cat <<EOF | "${KIND}" create cluster --name "${KIND_CLUSTER_NAME}" --config=-
68148
kind: Cluster
69149
apiVersion: kind.x-k8s.io/v1alpha4
70150
nodes:
71151
- role: control-plane
72152
extraMounts:
73-
- hostPath: $HOME/azwi/creds/sa.pub
153+
- hostPath: $SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH
74154
containerPath: /etc/kubernetes/pki/sa.pub
75-
- hostPath: $HOME/azwi/creds/sa.key
155+
- hostPath: $SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH
76156
containerPath: /etc/kubernetes/pki/sa.key
77157
kubeadmConfigPatches:
78158
- |
@@ -102,11 +182,11 @@ EOF
102182
# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md
103183
if [ "$AZWI_ENABLED" == 'true' ]
104184
then
105-
echo "azwi is enabled..."
185+
echo "workload-identity is enabled..."
106186
checkAZWIENVPreReqsAndCreateFiles
107187
createKindForAZWI
108188
else
109-
echo "azwi is not enabled..."
189+
echo "workload-identity is not enabled..."
110190
cat <<EOF | ${KIND} create cluster --name "${KIND_CLUSTER_NAME}" --config=-
111191
kind: Cluster
112192
apiVersion: kind.x-k8s.io/v1alpha4

templates/azure-cluster-identity/azure-cluster-identity.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ metadata:
66
labels:
77
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
88
spec:
9-
type: ServicePrincipal
9+
type: WorkloadIdentity
1010
allowedNamespaces: {}
1111
tenantID: "${AZURE_TENANT_ID}"
12-
clientID: "${AZURE_CLIENT_ID}"
13-
clientSecret: {"name":"${AZURE_CLUSTER_IDENTITY_SECRET_NAME}","namespace":"${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}"}
12+
clientID: "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}"

0 commit comments

Comments
 (0)