Skip to content

Instantly share code, notes, and snippets.

@joeywhelan
Created December 31, 2024 16:26

Revisions

  1. joeywhelan created this gist Dec 31, 2024.
    22 changes: 22 additions & 0 deletions kind.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    echo -e "\n*** Deploy Cloud Provider Kind ***"
    docker run -d --rm --name cloud-provider-kind --network kind \
    -v /var/run/docker.sock:/var/run/docker.sock registry.k8s.io/cloud-provider-kind/cloud-controller-manager:v0.4.0

    echo -e "\n*** Deploy Kind Cluster ***"
    kind create cluster --config=$PWD/kind/config.yaml --name demo-kind-cluster

    if [ -z "$(docker image ls -q ms1:1.0)" ]
    then
    echo -e "\n*** Build Microservice 1 Container ***"
    docker build --no-cache --tag ms1:1.0 $PWD/ms1
    fi

    if [ -z "$(docker image ls -q ms2:1.0)" ]
    then
    echo -e "\n*** Build Microservice 2 Container ***"
    docker build --no-cache --tag ms2:1.0 $PWD/ms2
    fi

    echo -e "\n*** Load Microservice Images ***"
    kind --name demo-kind-cluster load docker-image ms1:1.0
    kind --name demo-kind-cluster load docker-image ms2:1.0