Skip to content

Commit da763bd

Browse files
authored
Merge pull request #4946 from nojnhuh/ci-entrypoint-aks
allow managed clusters for ci-entrypoint
2 parents 5b87067 + 1191658 commit da763bd

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ create-workload-cluster: $(ENVSUBST) $(KUBECTL) ## Create a workload cluster.
363363
fi
364364

365365
# Wait for the kubeconfig to become available.
366-
timeout --foreground 300 bash -c "while ! $(KUBECTL) get secrets | grep $(CLUSTER_NAME)-kubeconfig; do sleep 1; done"
366+
timeout --foreground 1800 bash -c "while ! $(KUBECTL) get secrets | grep $(CLUSTER_NAME)-kubeconfig; do sleep 1; done"
367367
# Get kubeconfig and store it locally.
368368
$(KUBECTL) get secrets $(CLUSTER_NAME)-kubeconfig -o json | jq -r .data.value | base64 --decode > ./kubeconfig
369369
$(KUBECTL) wait --for=condition=Ready --timeout=10m cluster "$(CLUSTER_NAME)"

hack/create-dev-cluster.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export CLUSTER_TEMPLATE="${CLUSTER_TEMPLATE:-cluster-template.yaml}"
6262
export AZURE_CLUSTER_IDENTITY_SECRET_NAME="cluster-identity-secret"
6363
export CLUSTER_IDENTITY_NAME=${CLUSTER_IDENTITY_NAME:="cluster-identity"}
6464
export AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE="default"
65+
export ASO_CREDENTIAL_SECRET_NAME=${ASO_CREDENTIAL_SECRET_NAME:="aso-credentials"}
6566

6667
# Generate SSH key.
6768
capz::util::generate_ssh_key

scripts/ci-entrypoint.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ wait_for_pods() {
200200
}
201201

202202
install_addons() {
203-
# export the target cluster KUBECONFIG if not already set
204-
export KUBECONFIG="${KUBECONFIG:-${PWD}/kubeconfig}"
205203
until copy_kubeadm_config_map; do
206204
sleep 5
207205
done
@@ -250,8 +248,16 @@ export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
250248
# create cluster
251249
create_cluster
252250

253-
# install CNI and CCM
254-
install_addons
251+
# export the target cluster KUBECONFIG if not already set
252+
export KUBECONFIG="${KUBECONFIG:-${PWD}/kubeconfig}"
253+
254+
if [[ ! "${CLUSTER_TEMPLATE}" =~ "aks" ]]; then
255+
# install CNI and CCM
256+
install_addons
257+
fi
258+
259+
"${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" wait --for=condition=Ready --timeout=10m -l "cluster.x-k8s.io/cluster-name=${CLUSTER_NAME}" machinedeployments,machinepools
260+
255261
echo "Cluster ${CLUSTER_NAME} created and fully operational"
256262

257263
if [[ "${#}" -gt 0 ]]; then

scripts/kind-with-registry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ EOF
147147
AZURE_IDENTITY_ID=$(az identity show -n "${USER_IDENTITY}" -g "${AZWI_RESOURCE_GROUP}" --query clientId -o tsv)
148148
AZURE_IDENTITY_ID_PRINCIPAL_ID=$(az identity show -n "${USER_IDENTITY}" -g "${AZWI_RESOURCE_GROUP}" --query principalId -o tsv)
149149
echo "${AZURE_IDENTITY_ID}" > "${AZURE_IDENTITY_ID_FILEPATH}"
150-
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
150+
until az role assignment create --assignee-object-id "${AZURE_IDENTITY_ID_PRINCIPAL_ID}" --role "Owner" --scope "/subscriptions/${AZURE_SUBSCRIPTION_ID}" --assignee-principal-type ServicePrincipal --output none --only-show-errors; do
151151
sleep 5
152152
done
153153
az identity federated-credential create -n "capz-federated-identity" \

0 commit comments

Comments
 (0)