Skip to content

Commit

Permalink
Cilium on dev playground, bugfix missing IP DNS zone script (#1382)
Browse files Browse the repository at this point in the history
* Enable CILIUM in Dev and playground.env

* Move ingress ip (erlaier managed by install helm ingress charts)

* remove unused version
  • Loading branch information
Richard87 authored Jul 1, 2024
1 parent c684f8a commit 6b39fe5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/aks/development.env
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ SYSTEM_MIN_COUNT="2"

POD_PER_NODE="110" # how many pods each node can run. Max in AKS and k8s is 110
OUTBOUND_IP_COUNT="2" # how many public ips will be assigned to the cluster.
CILIUM=false
CILIUM_VERSION="1.14.1"
CILIUM=true

#######################################################################################
### Advanced networking
Expand Down
1 change: 1 addition & 0 deletions scripts/aks/playground.env
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ SYSTEM_MIN_COUNT="2"

POD_PER_NODE="110" # how many pods each node can run. Max in AKS and k8s is 110
OUTBOUND_IP_COUNT="2" # how many public ips will be assigned to the cluster.
CILIUM=true

#######################################################################################
### Advanced networking
Expand Down
37 changes: 37 additions & 0 deletions scripts/move_custom_ingresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ fi

source ${RADIX_PLATFORM_REPOSITORY_PATH}/scripts/utility/util.sh


LIB_DNS_SCRIPT="${RADIX_PLATFORM_REPOSITORY_PATH}/scripts/dns/lib_dns.sh"
if ! [[ -x "$LIB_DNS_SCRIPT" ]]; then
# Print to stderror
echo "ERROR: The lib DNS script is not found or it is not executable in path $LIB_DNS_SCRIPT" >&2
else
source $LIB_DNS_SCRIPT
fi

#######################################################################################
### Resolve dependencies on other scripts
###
Expand Down Expand Up @@ -283,6 +292,34 @@ printf "Point to destination cluster... "
get_credentials "$AZ_RESOURCE_GROUP_CLUSTERS" "$DEST_CLUSTER"
[[ "$(kubectl config current-context)" != "$DEST_CLUSTER" ]] && exit 1


#######################################################################################
### Configure DNS Record to point to new cluster
###

echo ""
printf "Updating DNS zone for %s... " "${AZ_RESOURCE_GROUP_COMMON}"

# Get cluster IP
cluster_ip=$(kubectl get secret --namespace "ingress-nginx" "ingress-nginx-raw-ip" -ojson | jq .data.rawIp --raw-output | base64 --decode)

set -f
a_records=('@' '*' '*.app')
# Create A records in the dns zone
# creating the "@"-record, i.e. e.g. dev.radix.equinor.com.
# creating wildcard record to match all FQDNs in active-cluster ingresses
# creating wildcard record to match all FQDNs in "app alias" ingresses
for record in ${a_records[@]}; do

printf "%s... " $record
create-a-record "${record}" "$cluster_ip" "$AZ_RESOURCE_GROUP_COMMON" "$AZ_RESOURCE_DNS" "60" || {
echo "ERROR: failed to create A record ${record}.${AZ_RESOURCE_DNS}" >&2
}
done
set +f
printf "Done. \n"


echo ""
printf "Update auth proxy secret and redis cache...\n"
printf "%s► Execute %s%s\n" "${grn}" "$UPDATE_AUTH_PROXY_SECRET_FOR_CONSOLE_SCRIPT" "${normal}"
Expand Down

0 comments on commit 6b39fe5

Please sign in to comment.