#!/bin/bash
kubectl exec -it nginx-deploy-0 -n edoc2 -- sed -i 's/server es/server es-deploy-0.ecm-es.edoc2.svc.cluster.local/g' /opt/nginx/upstream_conf/es/standalone.conf
kubectl exec -it nginx-deploy-0 -n edoc2 -- sed -i 's/server mysql/server mysql-deploy-0.ecm-mysql.edoc2.svc.cluster.local/g' /opt/nginx/upstream_conf/mysql/standalone.conf
kubectl exec -it nginx-deploy-0 -n edoc2 -- sed -i 's/server redis/server redis-deploy-0.ecm-redis.edoc2.svc.cluster.local/g' /opt/nginx/upstream_conf/redis/standalone.conf
kubectl exec -it nginx-deploy-0 -n edoc2 -- sed -i 's/server rabbitmq/server rabbitmq-deploy-0.ecm-rabbitmq.edoc2.svc.cluster.local/g' /opt/nginx/upstream_conf/rabbitmq/standalone.conf
kubectl exec -it nginx-deploy-0 -n edoc2 -- sed -i "s/append_upstream_conf \${svc} \${MIDDLEWARE} \${PROXY_CONF}/append_upstream_conf \`echo \${svc}\|awk -F '-' '{print \$1}'\` \${MIDDLEWARE} \${PROXY_CONF}/g" /etc/nginx/proxy.sh
