forked from openfaas/faas-netes
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test current PR build and add local registry in KinD #1
Open
matzhaugen
wants to merge
24
commits into
master
Choose a base branch
from
local-registry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7d05791
regress go
matzhaugen a87cb3e
Separate for speed
matzhaugen b06c583
small syntax fix
matzhaugen 0b303d1
fix operator test
matzhaugen 2fdfce8
Add comments
matzhaugen 232ed7d
Fix logic
matzhaugen e84e4f3
Fix exit status
matzhaugen b490d79
simplify
matzhaugen 27527e2
Add pull request back
matzhaugen f00e6de
whitespace
matzhaugen 1802dea
debug
matzhaugen 560f85b
fix registry script
matzhaugen 883f2da
remove pull request
matzhaugen 8239a92
remove simplify
matzhaugen 3fbbf4e
Change logs
matzhaugen 13e1942
Merge branch 'master' into local-registry
matzhaugen 099930a
typo
matzhaugen 083595f
Add load testing script
matzhaugen 0c2dccf
add load test
matzhaugen 6e4cd1f
install hey
matzhaugen 2f35896
Add wait for rollout
matzhaugen ee9fa08
add operator image
matzhaugen 458b926
Add kustomize
matzhaugen 7c16d89
Add kustomize
matzhaugen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
DEVENV=${OF_DEV_ENV:-kind} | ||
KUBE_VERSION=v1.18.8 | ||
REG_NAME=kind-registry | ||
REG_PORT=5000 | ||
|
||
./contrib/create_local_registry.sh ${REG_NAME} ${REG_PORT} | ||
echo ">>> Creating Kubernetes ${KUBE_VERSION} cluster ${DEVENV}" | ||
|
||
kind create cluster --wait 5m --image kindest/node:${KUBE_VERSION} --name "$DEVENV" -v 1 | ||
# create a cluster with the local registry enabled in containerd | ||
cat <<EOF | kind create cluster \ | ||
--wait 5m --image kindest/node:${KUBE_VERSION} --name "$DEVENV" -v 1 --config=- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
containerdConfigPatches: | ||
- |- | ||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."${REG_NAME}:${REG_PORT}"] | ||
endpoint = ["http://${REG_NAME}:${REG_PORT}"] | ||
EOF | ||
|
||
|
||
# connect the registry to the cluster network | ||
# (the network may already be connected) | ||
containers=$(docker network inspect kind -f "{{range .Containers}}{{.Name}} {{end}}") | ||
needs_connect="true" | ||
for c in $containers; do | ||
if [ "$c" = "${reg_name}" ]; then | ||
needs_connect="false" | ||
fi | ||
done | ||
if [ "${needs_connect}" = "true" ]; then | ||
docker network connect "kind" "${REG_NAME}" || true | ||
else | ||
echo ">>> Kind network already connected to local registry" | ||
fi | ||
|
||
|
||
echo ">>> Waiting for CoreDNS" | ||
kubectl --context "kind-$DEVENV" -n kube-system rollout status deployment/coredns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# create registry container unless it already exists | ||
REG_NAME=${1:-kind-registry} | ||
REG_PORT=${2:-5000} | ||
running="$(docker inspect -f '{{.State.Running}}' "${REG_NAME}" 2>/dev/null || false)" | ||
if [ "${running}" != 'true' ]; then | ||
docker run \ | ||
-d --restart=always -p "127.0.0.1:${REG_PORT}:5000" --name "${REG_NAME}" \ | ||
registry:2 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Load test with scaling | ||
|
||
FXN_NAME=echo | ||
export OPENFAAS_URL=http://127.0.0.1:31112 | ||
hey -z=5s -q 5 -c 2 -m POST -d=Test $OPENFAAS_URL/function/$FXN_NAME # All should give 200 | ||
sleep 5 | ||
kubectl scale --replicas=0 deploy/$FXN_NAME -n openfaas-fn | ||
kubectl scale --replicas=1 deploy/$FXN_NAME -n openfaas-fn | ||
kubectl --context "kind-kind" rollout status deploy/$FXN_NAME -n openfaas-fn --timeout=4m | ||
hey -z=5s -q 5 -c 2 -m POST -d=Test $OPENFAAS_URL/async-function/$FXN_NAME | ||
kubectl scale --replicas=0 deploy/$FXN_NAME -n openfaas-fn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Load test with scaling | ||
DEVENV=${DEVENV:-kind} | ||
export OPENFAAS_URL=http://127.0.0.1:31112 | ||
hey -z=5s -q 5 -c 2 -m POST -d=Test $OPENFAAS_URL/async-function/sleep | ||
hey -z=5s -q 5 -c 2 -m POST -d=Test $OPENFAAS_URL/function/sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Load test with scaling | ||
|
||
export OPENFAAS_URL=http://127.0.0.1:31112 | ||
# Start with a fresh slate to emulate scale to zero | ||
kubectl scale --replicas=0 deploy/echo -n openfaas-fn | ||
sleep 11 | ||
|
||
# Start request batch #1 | ||
curl -X POST -d Test $OPENFAAS_URL/function/echo # scale to 1 | ||
hey -z=2s -q 5 -c 2 -m POST -d Test $OPENFAAS_URL/function/echo | ||
sleep 5 # Necessary to not get 404 | ||
# Scale back to zero | ||
kubectl scale --replicas=0 deploy/echo -n openfaas-fn | ||
# sleep 5 | ||
# Start request batch #2 | ||
hey -z=2s -q 5 -c 2 -m POST -d Test $OPENFAAS_URL/function/echo # gives 404 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build was building twice for each push so I removed this. I can put it back in if you want.