Skip to content

Commit

Permalink
* classify between darwin vs. linux systems when running `ci/depl…
Browse files Browse the repository at this point in the history
…oy-to-kind-cluster.sh`

* default `KUBE2E_TESTS` to `eds`, rather than nothing

This commit can be used to run `ci/deploy-to-kind-cluster.sh` on a mac off of a fresh clone with no configuration

One of the more common use-cases for `deploy-to-kind-cluster` is in local development.  _Currently_, when running the script, some tweaks are needed to have it _succeed_ on a Mac.  This is a bit painful, and is time that not every person on a Mac should need to figure out in order to test locally.

- [ ] I included a concise, user-facing changelog (for details, see https://github.com/solo-io/go-utils/tree/master/changelogutils) which references the issue that is resolved.
- [x] If I updated APIs (our protos) or helm values, I ran `make -B install-go-tools generated-code` to ensure there will be no code diff
- [x] I followed guidelines laid out in the Gloo Edge [contribution guide](https://docs.solo.io/gloo-edge/latest/contributing/)
- [x] I opened a draft PR or added the work in progress label if my PR is not ready for review
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
  • Loading branch information
gunnar-solo committed Oct 14, 2021
1 parent aff2493 commit fad3d67
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ci/deploy-to-kind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ CLUSTER_NAME="${CLUSTER_NAME:-kind}"
CLUSTER_NODE_VERSION="${CLUSTER_NODE_VERSION:-v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00}"
# The version used to tag images
VERSION="${VERSION:-0.0.0-kind}"
# Automatically (lazily) determine OS type
if [[ $OSTYPE == 'darwin'* ]]; then
OS='darwin'
else
OS='linux'
fi
# Offer a default value for type of installation
KUBE2E_TESTS='eds'

# 1. Create a kind cluster (or skip creation if a cluster with name=CLUSTER_NAME already exists)
# This config is roughly based on: https://kind.sigs.k8s.io/docs/user/ingress/
Expand Down Expand Up @@ -59,12 +67,12 @@ VERSION=$VERSION CLUSTER_NAME=$CLUSTER_NAME make push-kind-images
VERSION=$VERSION make build-test-chart

# 4. Build the gloo command line tool, ensuring we have one in the `_output` folder
make glooctl-linux-amd64
make glooctl-$OS-amd64

# 5. Install additional resources used for particular KUBE2E tests
if [ "$KUBE2E_TESTS" = "eds" ]; then
echo "Installing Gloo Edge"
_output/glooctl-linux-amd64 install gateway --file "_test/gloo-$VERSION".tgz
_output/glooctl-$OS-amd64 install gateway --file "_test/gloo-$VERSION".tgz

kubectl -n gloo-system rollout status deployment gloo --timeout=2m || true
kubectl -n gloo-system rollout status deployment discovery --timeout=2m || true
Expand All @@ -73,7 +81,7 @@ if [ "$KUBE2E_TESTS" = "eds" ]; then

echo "Installing Hello World example"
kubectl apply -f https://raw.githubusercontent.com/solo-io/gloo/v1.2.9/example/petstore/petstore.yaml
_output/glooctl-linux-amd64 add route \
_output/glooctl-$OS-amd64 add route \
--path-exact /all-pets \
--dest-name default-petstore-8080 \
--prefix-rewrite /api/pets
Expand Down

0 comments on commit fad3d67

Please sign in to comment.