Skip to content

Commit

Permalink
renamed k3d create clusters to original name to prevent confusion on …
Browse files Browse the repository at this point in the history
…running individual commands
  • Loading branch information
rasswanth-s committed Sep 19, 2024
1 parent 02c4561 commit da5dc2c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ set dotenv-load

# ---------------------------------------------------------------------------------------------------------------------

cluster_default := "k3d-syft-dev"
cluster_high := "k3d-syft-high"
cluster_low := "k3d-syft-low"
cluster_gw := "k3d-syft-gw"
cluster_signoz := "k3d-signoz"
cluster_default := "syft-dev"
cluster_high := "syft-high"
cluster_low := "syft-low"
cluster_gw := "syft-gw"
cluster_signoz := "signoz"
ns_default := "syft"
ns_high := "high"
ns_low := "low"
Expand Down Expand Up @@ -248,21 +248,20 @@ create-cluster cluster port *args='': start-registry && (apply-coredns cluster)
#!/bin/bash
set -euo pipefail

# remove the k3d- prefix
CLUSTER_NAME=$(echo "{{ cluster }}" | sed -e 's/k3d-//g')

k3d cluster create $CLUSTER_NAME \
k3d cluster create {{cluster}} \
--port {{ port }}:80@loadbalancer \
--registry-use k3d-registry.localhost:5800 {{ args }}

# Since k3d adds k3d- prefix to the cluster name
# we create a new context without the prefix
kubectl config rename-context k3d-{{cluster}} {{cluster}}

[group('cluster')]
[private]
delete-cluster *args='':
#!/bin/bash
set -euo pipefail

# remove the k3d- prefix
ARGS=$(echo "{{ args }}" | sed -e 's/k3d-//g')
k3d cluster delete $ARGS

[group('cluster')]
Expand Down

0 comments on commit da5dc2c

Please sign in to comment.