From 7b581f3f68801b1a2d4e0cef2f0db86ae71c9141 Mon Sep 17 00:00:00 2001 From: Naveen Angali Date: Fri, 6 Oct 2023 16:27:58 -0400 Subject: [PATCH] Added coredns-custom config details --- Azure-ARM/coredns-config.yaml | 15 +++++++++++++++ Azure-ARM/deployprofisee.sh | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Azure-ARM/coredns-config.yaml diff --git a/Azure-ARM/coredns-config.yaml b/Azure-ARM/coredns-config.yaml new file mode 100644 index 0000000..35a78d4 --- /dev/null +++ b/Azure-ARM/coredns-config.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns-custom + namespace: kube-system +data: + Profisee.server: | + $EXTERNALDNSNAME:53 { + rewrite name $EXTERNALDNSNAME nginx-ingress-nginx-controller.profisee.svc.cluster.local + kubernetes cluster.local in-addr.arpa ip6.arpa { + pods insecure + fallthrough in-addr.arpa ipv6.arpa + ttl 30 + } + } diff --git a/Azure-ARM/deployprofisee.sh b/Azure-ARM/deployprofisee.sh index 9a1d24f..8c81142 100644 --- a/Azure-ARM/deployprofisee.sh +++ b/Azure-ARM/deployprofisee.sh @@ -486,7 +486,7 @@ if [ "$WINDOWS_NODE_VERSION" = "Windows2019" ]; then helm repo add azurefile-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/charts helm repo update azurefile-csi-driver #Controller Replicas MUST be 2 in Prod, okay to be 1 in Dev (i.e. do NOT add --set controller.replica=1 in Prod). This is dependent on number of available Linux nodes in the nodepool. In Prod, it is minimum of 2, Dev is 1. - helm install azurefile-csi-driver azurefile-csi-driver/azurefile-csi-driver --namespace kube-system --set controller.replicas=1 + helm install azurefile-csi-driver azurefile-csi-driver/azurefile-csi-driver --namespace kube-system --set controller.replicas=1 echo $"Azure File CSI Driver installation finished." fi @@ -511,6 +511,9 @@ echo $"The safe RAM value to assign to Profisee pod is $saferamvalueinkibibytes. # echo $"Profisee's stateful set has been patched to use $safecpuvalueinmilicores for CPU." # kubectl patch statefulsets -n profisee profisee --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources/limits/memory", "value":'"$saferamvalueinkibibytes"'}]' # echo $"Profisee's stateful set has been patched to use $saferamvalueinkibibytes for RAM." +#settings DNSName value to custom coredns-configmap +curl -fsSL -o coredns-config.yaml "$REPOURL/Azure-ARM/coredns-config.yaml"; +sed -i -e 's/$EXTERNALDNSNAME/'"$EXTERNALDNSNAME"'/g' coredns-config.yaml #Setting values in the Settings.yaml sed -i -e 's/$SQLNAME/'"$SQLNAME"'/g' Settings.yaml @@ -592,6 +595,9 @@ fi kubectl delete secret profisee-settings -n profisee --ignore-not-found kubectl create secret generic profisee-settings -n profisee --from-file=Settings.yaml +#Replacing Coredns with custom coredns config map +kubectl replace -f ./coredns-config.yaml + #Adding this only in dev environment so SuperAdmin can edit the app registration values. Please do not implement this in Prod ObjectId="$(az ad user show --id $ADMINACCOUNTNAME --query id -o tsv)" echo $"ObjectId of ADMIN is $ObjectId";