mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-05-05 12:32:34 +02:00
Remove support for federation in deploy script (#229)
* remove support for federation in deploy script * remove get node permissions Signed-off-by: Sandeep Rajan <srajan@infoblox.com>
This commit is contained in:
parent
69fc3d9f27
commit
916d90420d
2 changed files with 1 additions and 18 deletions
|
@ -21,12 +21,6 @@ rules:
|
||||||
verbs:
|
verbs:
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
- apiGroups:
|
|
||||||
- ""
|
|
||||||
resources:
|
|
||||||
- nodes
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
@ -60,7 +54,7 @@ data:
|
||||||
ready
|
ready
|
||||||
kubernetes CLUSTER_DOMAIN REVERSE_CIDRS {
|
kubernetes CLUSTER_DOMAIN REVERSE_CIDRS {
|
||||||
fallthrough in-addr.arpa ip6.arpa
|
fallthrough in-addr.arpa ip6.arpa
|
||||||
}FEDERATIONS
|
}
|
||||||
prometheus :9153
|
prometheus :9153
|
||||||
forward . UPSTREAMNAMESERVER
|
forward . UPSTREAMNAMESERVER
|
||||||
cache 30
|
cache 30
|
||||||
|
|
|
@ -23,23 +23,13 @@ CLUSTER_DOMAIN=cluster.local
|
||||||
YAML_TEMPLATE="$DIR/coredns.yaml.sed"
|
YAML_TEMPLATE="$DIR/coredns.yaml.sed"
|
||||||
STUBDOMAINS=""
|
STUBDOMAINS=""
|
||||||
UPSTREAM=\\/etc\\/resolv\.conf
|
UPSTREAM=\\/etc\\/resolv\.conf
|
||||||
FEDERATIONS=""
|
|
||||||
|
|
||||||
|
|
||||||
# Translates the kube-dns ConfigMap to equivalent CoreDNS Configuration.
|
# Translates the kube-dns ConfigMap to equivalent CoreDNS Configuration.
|
||||||
function translate-kube-dns-configmap {
|
function translate-kube-dns-configmap {
|
||||||
kube-dns-federation-to-coredns
|
|
||||||
kube-dns-upstreamnameserver-to-coredns
|
kube-dns-upstreamnameserver-to-coredns
|
||||||
kube-dns-stubdomains-to-coredns
|
kube-dns-stubdomains-to-coredns
|
||||||
}
|
}
|
||||||
|
|
||||||
function kube-dns-federation-to-coredns {
|
|
||||||
fed=$(kubectl -n kube-system get configmap kube-dns -ojsonpath='{.data.federations}' 2> /dev/null | jq . | tr -d '":,')
|
|
||||||
if [[ ! -z ${fed} ]]; then
|
|
||||||
FEDERATIONS=$(sed -e '1s/^/federation /' -e 's/^/ /' -e '1i\\' <<< "${fed}") # add federation to the stanza
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function kube-dns-upstreamnameserver-to-coredns {
|
function kube-dns-upstreamnameserver-to-coredns {
|
||||||
up=$(kubectl -n kube-system get configmap kube-dns -ojsonpath='{.data.upstreamNameservers}' 2> /dev/null | tr -d '[",]')
|
up=$(kubectl -n kube-system get configmap kube-dns -ojsonpath='{.data.upstreamNameservers}' 2> /dev/null | tr -d '[",]')
|
||||||
if [[ ! -z ${up} ]]; then
|
if [[ ! -z ${up} ]]; then
|
||||||
|
@ -127,6 +117,5 @@ sed -e "s/CLUSTER_DNS_IP/$CLUSTER_DNS_IP/g" \
|
||||||
-e "s/CLUSTER_DOMAIN/$CLUSTER_DOMAIN/g" \
|
-e "s/CLUSTER_DOMAIN/$CLUSTER_DOMAIN/g" \
|
||||||
-e "s?REVERSE_CIDRS?$REVERSE_CIDRS?g" \
|
-e "s?REVERSE_CIDRS?$REVERSE_CIDRS?g" \
|
||||||
-e "s@STUBDOMAINS@${STUBDOMAINS//$orig/$replace}@g" \
|
-e "s@STUBDOMAINS@${STUBDOMAINS//$orig/$replace}@g" \
|
||||||
-e "s@FEDERATIONS@${FEDERATIONS//$orig/$replace}@g" \
|
|
||||||
-e "s/UPSTREAMNAMESERVER/$UPSTREAM/g" \
|
-e "s/UPSTREAMNAMESERVER/$UPSTREAM/g" \
|
||||||
"${YAML_TEMPLATE}"
|
"${YAML_TEMPLATE}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue