forked from openfaas/faas-netes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit merges the code of the operator into the faas-netes repo, so that the two controllers can be worked on together and kept in sync. * Consolidate CI to run both sets of e2e tests for the two controllers. * Update helm to use RC controller release Tested with faas-netes and operator switched in place using instructions in the PR. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
- Loading branch information
Showing
482 changed files
with
68,392 additions
and
9,834 deletions.
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
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,8 @@ | ||
apiVersion: openfaas.com/v1 | ||
kind: Function | ||
metadata: | ||
name: nodeinfo | ||
namespace: openfaas-fn | ||
spec: | ||
name: nodeinfo | ||
image: functions/nodeinfo:latest |
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,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
DEVENV=${OF_DEV_ENV:-kind} | ||
KUBE_VERSION=v1.17.0 | ||
|
||
echo ">>> Creating Kubernetes ${KUBE_VERSION} cluster" | ||
kind create cluster --wait 5m --image kindest/node:${KUBE_VERSION} --name "$DEVENV" | ||
|
||
export KUBECONFIG="$(kind get kubeconfig-path --name="$DEVENV")" | ||
|
||
echo ">>> Waiting for CoreDNS" | ||
kubectl -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
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
KIND_VERSION="v0.7.0" | ||
HELM_VERSION=v3.0.3 | ||
KUBE_VERSION=v0.7.0 | ||
|
||
if [[ "$1" ]]; then | ||
KUBE_VERSION=$1 | ||
fi | ||
|
||
echo ">>> Installing kind $KIND_VERSION" | ||
curl -sSLfO kind "https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VERSION/kind-linux-amd64" | ||
chmod +x kind | ||
sudo mv kind /usr/local/bin/kind | ||
|
||
echo ">>> Installing kubectl" | ||
curl -sSLfO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ | ||
chmod +x kubectl && \ | ||
sudo mv kubectl /usr/local/bin/ | ||
|
||
echo ">>> Installing Helm v3" | ||
curl -sSLf https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar xz && \ | ||
sudo mv linux-amd64/helm /usr/local/bin/ && \ | ||
rm -rf linux-amd64 | ||
|
||
echo ">>> Installing faas-cli" | ||
curl -sSLf https://cli.openfaas.com | sudo sh | ||
faas-cli version |
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,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
OPERATOR=${OPERATOR:-0} | ||
|
||
CREATE_OPERATOR=false | ||
|
||
if [ "${OPERATOR}" == "1" ]; then | ||
CREATE_OPERATOR="true" | ||
fi | ||
|
||
echo "Waiting for helm install to complete." | ||
|
||
echo helm upgrade \ | ||
--install \ | ||
openfaas \ | ||
./chart/openfaas \ | ||
--namespace openfaas \ | ||
--set basic_auth=true \ | ||
--set functionNamespace=openfaas-fn \ | ||
--set operator.create=$CREATE_OPERATOR \ | ||
--wait |
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,6 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
DEVENV=${OF_DEV_ENV:-kind} | ||
|
||
if [ -f "of_${DEVENV}_portforward.pid" ]; then | ||
|
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
|
||
HELM_VERSION=v3.0.3 | ||
KIND_VERSION=v0.7.0 | ||
KUBE_VERSION=v1.17.0 | ||
|
||
if [[ "$1" ]]; then | ||
KUBE_VERSION=$1 | ||
fi | ||
|
||
echo ">>> Installing kubectl" | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ | ||
chmod +x kubectl && \ | ||
sudo mv kubectl /usr/local/bin/ | ||
|
||
echo ">>> Installing kind $VER" | ||
|
||
curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VERSION/kind-linux-amd64" | ||
chmod +x kind | ||
sudo mv kind /usr/local/bin/kind | ||
|
||
echo ">>> Creating Kubernetes ${KUBE_VERSION} cluster" | ||
kind create cluster --wait 5m --image kindest/node:${KUBE_VERSION} | ||
|
||
echo ">>> Waiting for CoreDNS" | ||
kubectl -n kube-system rollout status deployment/coredns | ||
|
||
echo ">>> Installing Helm v3" | ||
curl -sSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar xz && \ | ||
sudo mv linux-amd64/helm /usr/local/bin/ && \ | ||
rm -rf linux-amd64 | ||
|
||
echo ">>> Add OpenFaaS Helm repo" | ||
helm repo add openfaas https://openfaas.github.io/faas-netes/ |
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,61 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
|
||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
logs() { | ||
kubectl -n openfaas get all | ||
kubectl -n openfaas describe deployment/gateway | ||
kubectl -n openfaas logs deployment/gateway -c operator | ||
} | ||
trap "logs" EXIT SIGINT | ||
|
||
echo ">>> Load OpenFaaS operator local image onto the cluster" | ||
docker tag openfaas/openfaas-operator:latest test/openfaas-operator:latest | ||
kind load docker-image test/openfaas-operator:latest | ||
|
||
echo ">>> Create OpenFaaS namespaces" | ||
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml | ||
|
||
echo ">>> Create OpenFaaS CRD" | ||
kubectl apply -f ${REPO_ROOT}/artifacts/operator-crd.yaml | ||
|
||
echo ">>> Install OpenFaaS with Helm" | ||
# the pull policy must be set to IfNotPresent for Kubernetes | ||
# to load the locally built image | ||
# we disable NATS and faasIdler as they slow down the startup | ||
# and have no impact on the operator testing | ||
helm upgrade -i openfaas openfaas/openfaas \ | ||
--namespace openfaas \ | ||
--set openfaasImagePullPolicy=IfNotPresent \ | ||
--set functionNamespace=openfaas-fn \ | ||
--set basic_auth=false \ | ||
--set async=false \ | ||
--set faasIdler.create=false \ | ||
--set operator.create=true \ | ||
--set operator.createCRD=false \ | ||
--set operator.image=test/openfaas-operator:latest | ||
|
||
echo ">>> Patch operator deployment" | ||
# we patch the operator deployment to make it | ||
# compatible with the current build | ||
TEMP_DIR=$(mktemp -d) | ||
cat > ${TEMP_DIR}/patch.yaml << EOL | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: operator | ||
command: | ||
- ./openfaas-operator | ||
EOL | ||
kubectl -n openfaas patch deployment gateway --patch "$(cat ${TEMP_DIR}/patch.yaml)" | ||
|
||
echo ">>> Wait for operator deployment to be ready" | ||
kubectl -n openfaas rollout status deployment/gateway --timeout=60s | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.