Skip to content

Commit

Permalink
[dev-env] dev/demo environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ktatarnikov committed Feb 12, 2025
1 parent 60aebb9 commit 0a1fd62
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
22 changes: 13 additions & 9 deletions env/dev/applications.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# - KUBECONFIG: Path to the merged kubeconfig file.
#

CLUSTERS=("kind-cluster1" "kind-cluster2")
CLUSTERS=("kind-cluster1" "kind-cluster2" "kind-cluster3")

export KUBECONFIG=$(pwd)/target/merged-kubeconfig.yaml

Expand Down Expand Up @@ -52,6 +52,13 @@ main() {
esac
}

applications_install() {
validate
generate_secrets
kustomize_bundle_all
install_applications_all
}

validate() {

if ! command -v kubectl &> /dev/null; then
Expand Down Expand Up @@ -121,13 +128,6 @@ install_applications() {
kubectl --context kind-${cluster} create -f ./target/${cluster}.bundle.yaml
}

applications_install() {
validate
generate_secrets
kustomize_bundle_all
install_applications_all
}

applications_uninstall() {
validate
delete_applications_all
Expand Down Expand Up @@ -164,7 +164,11 @@ services_list() {
local cluster=$1

echo "### List Services in cluster $cluster ..."
kubectl --context kind-kind-cluster1 get svc -A --field-selector spec.type=LoadBalancer -o json \
echo "-----------------------------------------------"
echo "SERVICE | EXTERNAL-IP:PORT"
echo "-----------------------------------------------"

kubectl --context kind-$cluster get svc -A --field-selector spec.type=LoadBalancer -o json \
| jq -r '.items[] | select(.status.loadBalancer.ingress) | "\(.metadata.name) \(.status.loadBalancer.ingress[0].ip):\(.spec.ports[].port)"' \
| column -t -s' '
}
Expand Down
16 changes: 8 additions & 8 deletions env/dev/argocd.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
# 4. Retrieves and displays the initial admin password for ArgoCD on all specified clusters.
#
#
CLUSTERS=("kind-cluster1" "kind-cluster2")
CLUSTERS=("kind-cluster1" "kind-cluster2" "kind-cluster3")

export KUBECONFIG=$(pwd)/target/merged-kubeconfig.yaml

main() {
install_argo_all
install_balancer_all
wait_pods_ready_all
list_argo_credentials_all
}

install_argo_all() {
echo "### Installing ArgoCD... ###"
for i in "${!CLUSTERS[@]}"; do
Expand Down Expand Up @@ -88,11 +95,4 @@ list_argo_credentials() {
echo "Argo CD password for cluster ${cluster} is ${ARGOCD_PWD}"
}

main() {
install_argo_all
install_balancer_all
wait_pods_ready_all
list_argo_credentials_all
}

main
2 changes: 1 addition & 1 deletion env/dev/clusters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# DEFAULT_DNS_IPS - Array of default DNS IPs for each cluster.
# NODES - Array of node roles for each cluster.
#
CLUSTERS=("kind-cluster1" "kind-cluster2")
CLUSTERS=("kind-cluster1" "kind-cluster2" "kind-cluster3")
POD_SUBNETS=("192.168.0.0" "192.169.0.0" "192.170.0.0")
SVC_SUBNETS=("10.96.0.0" "10.97.0.0" "10.98.0.0")
AS_NUMBERS=("65001" "65002" "65003")
Expand Down

0 comments on commit 0a1fd62

Please sign in to comment.