-
Notifications
You must be signed in to change notification settings - Fork 12
/
predeploy.sh
47 lines (41 loc) · 2.01 KB
/
predeploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
echo "Retrieving cluster credentials"
az aks get-credentials --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_AKS_CLUSTER_NAME}
# Add required Helm repos
helm repo add aso2 https://raw.githubusercontent.com/Azure/azure-service-operator/main/v2/charts
helm repo add kedacore https://kedacore.github.io/charts
helm repo add jetstack https://charts.jetstack.io
helm repo update
certmanagerStatus=$(helm status cert-manager -n cert-manager 2>&1)
if [[ $certmanagerStatus == *"Error: release: not found"* ]]; then
echo "cert-manager not installed, installing"
helm upgrade --install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.11.0 --set installCRDs=true
else
echo "cert-manager installed, skipping"
fi
echo "Checking if Azure Service Operator is installed"
aso2Status=$(helm status aso2 -n azureserviceoperator-system 2>&1)
if [[ $aso2Status == *"Error: release: not found"* ]]; then
echo "Azure Service Operator not installed, installing"
#kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.2/cert-manager.yaml
helm upgrade --install --devel aso2 aso2/azure-service-operator \
--create-namespace \
--namespace=azureserviceoperator-system \
--set azureSubscriptionID=${AZURE_SUBSCRIPTION_ID} \
--set azureTenantID=${AZURE_TENANT_ID} \
--set azureClientID=${ASO_WORKLOADIDENTITY_CLIENT_ID} \
--set useWorkloadIdentityAuth=true
else
echo "Azure Service Operator installed, skipping"
fi
# Temporary until KEDA add-on is updated to 2.10 which is needed for workload identity support in Prometheus scaler
echo "Checking if KEDA is installed"
kedatatus=$(helm status keda -n kube-system 2>&1)
if [[ $kedatatus == *"Error: release: not found"* ]]; then
echo "KEDA not installed, installing"
helm upgrade --install keda kedacore/keda \
--namespace kube-system \
--set podIdentity.azureWorkload.enabled=true
else
echo "KEDA installed, skipping"
fi