Skip to content

Commit

Permalink
Merge pull request #3560 from nawazkh/fix_aks_tilt_installation
Browse files Browse the repository at this point in the history
skip applying addons to aks flavor
  • Loading branch information
k8s-ci-robot authored May 12, 2023
2 parents d3023f8 + 194ef8c commit ed55528
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
36 changes: 24 additions & 12 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ settings = {
"kind_cluster_name": "capz",
"capi_version": "v1.4.2",
"cert_manager_version": "v1.11.1",
"kubernetes_version": "v1.24.6",
"aks_kubernetes_version": "v1.24.6",
"kubernetes_version": "v1.25.6",
"aks_kubernetes_version": "v1.25.6",
"flatcar_version": "3374.2.1",
}

Expand Down Expand Up @@ -366,16 +366,8 @@ def deploy_worker_templates(template, substitutions):
flavor_cmd += "; until " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig get configmap kubeadm-config --namespace=kube-system > /dev/null 2>&1; do sleep 5; done"
flavor_cmd += "; " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig create namespace calico-system --dry-run=client -o yaml | " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig apply -f -; " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig get configmap kubeadm-config --namespace=kube-system -o yaml | sed 's/namespace: kube-system/namespace: calico-system/' | " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig apply -f -"

# install calico
if "ipv6" in flavor_name:
calico_values = "./templates/addons/calico-ipv6/values.yaml"
elif "dual-stack" in flavor_name:
calico_values = "./templates/addons/calico-dual-stack/values.yaml"
else:
calico_values = "./templates/addons/calico/values.yaml"
flavor_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://docs.tigera.io/calico/charts calico tigera-operator -f " + calico_values + " --namespace tigera-operator --create-namespace"
if "intree-cloud-provider" not in flavor_name:
flavor_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"
flavor_cmd += get_addons(flavor_name)

local_resource(
name = flavor_name,
cmd = ["sh", "-ec", flavor_cmd],
Expand All @@ -385,6 +377,26 @@ def deploy_worker_templates(template, substitutions):
allow_parallel = True,
)

def get_addons(flavor_name):
# do not install calico and out of tree cloud provider for aks workload cluster
if "aks" in flavor_name:
return ""

# install calico
if "ipv6" in flavor_name:
calico_values = "./templates/addons/calico-ipv6/values.yaml"
elif "dual-stack" in flavor_name:
calico_values = "./templates/addons/calico-dual-stack/values.yaml"
else:
calico_values = "./templates/addons/calico/values.yaml"

addon_cmd = "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://docs.tigera.io/calico/charts calico tigera-operator -f " + calico_values + " --namespace tigera-operator --create-namespace"

if "intree-cloud-provider" not in flavor_name:
addon_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"

return addon_cmd

def base64_encode(to_encode):
encode_blob = local("echo '{}' | tr -d '\n' | base64 | tr -d '\n'".format(to_encode), quiet = True, echo_off = True)
return str(encode_blob)
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export CONTROL_PLANE_MACHINE_COUNT=3
export AZURE_CONTROL_PLANE_MACHINE_TYPE="Standard_B2s"
export AZURE_NODE_MACHINE_TYPE="Standard_B2s"
export WORKER_MACHINE_COUNT=2
export KUBERNETES_VERSION="v1.24.6"
export KUBERNETES_VERSION="v1.25.6"

# Identity secret.
export AZURE_CLUSTER_IDENTITY_SECRET_NAME="cluster-identity-secret"
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/topics/managedcluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ executing clusterctl.
# Kubernetes values
export CLUSTER_NAME="my-cluster"
export WORKER_MACHINE_COUNT=2
export KUBERNETES_VERSION="v1.24.6"
export KUBERNETES_VERSION="v1.25.6"

# Azure values
export AZURE_LOCATION="southcentralus"
Expand Down
2 changes: 1 addition & 1 deletion hack/create-dev-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-3}
export AZURE_CONTROL_PLANE_MACHINE_TYPE="${CONTROL_PLANE_MACHINE_TYPE:-Standard_B2s}"
export AZURE_NODE_MACHINE_TYPE="${NODE_MACHINE_TYPE:-Standard_B2s}"
export WORKER_MACHINE_COUNT=${WORKER_MACHINE_COUNT:-2}
export KUBERNETES_VERSION="${KUBERNETES_VERSION:-v1.24.6}"
export KUBERNETES_VERSION="${KUBERNETES_VERSION:-v1.25.6}"
export CLUSTER_TEMPLATE="${CLUSTER_TEMPLATE:-cluster-template.yaml}"

# identity secret settings.
Expand Down

0 comments on commit ed55528

Please sign in to comment.