UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 9808a815 authored by Micah Nagel's avatar Micah Nagel
Browse files

Merge branch 'BrandenCobb-master-patch-13208' into 'master'

Removed hosts.sh

See merge request platform-one/big-bang/bigbang!1052
parents 0e31943d 50a50bed
No related branches found
No related tags found
2 merge requests!1386Master,!1052Removed hosts.sh
Pipeline #546118 passed with warnings
......@@ -346,7 +346,6 @@ aws/rke2/bigbang test:
## putting it here now for a quick way to install dig
- echo -e "\e[0Ksection_start:`date +%s`:host_setup[collapsed=true]\r\e[0K\e[33;1mHost Setup\e[37m"
- yum install bind-utils -y
- ./scripts/hosts.sh
- echo -e "\e[0Ksection_end:`date +%s`:host_setup\r\e[0K"
- *test_bigbang
- |
......
#!/bin/bash
set -e
trap 'echo ❌ exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
## Adds all the vs hostnames and LB IP to /etc/hosts
## Get the LB Hostname
INGRESS_LB_Hostname=$(kubectl get svc -n istio-system public-ingressgateway -o jsonpath="{.status.loadBalancer.ingress[0].hostname}")
## Get IP address from Hostname
INGRESS_LB_IP=$(dig $INGRESS_LB_Hostname +search +short | head -1)
## Get a list of all the vs in cluster
VIRTUAL_SERVICES=$(kubectl get vs -A -o jsonpath={..spec.hosts[0]})
## For each vs put it in /etc/hosts
for vs in $VIRTUAL_SERVICES;
do echo "$INGRESS_LB_IP $vs" >> /etc/hosts
done
##Cat out the file to see what we've done
cat /etc/hosts
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment