- OpenFunction v0.4.0
minikube start -p demo --kubernetes-version=v1.22.2 --network-plugin=cni --cni=calico
# clone repo
git clone https://github.com/OpenFunction/OpenFunction.git
# enter the repo
cd openfunction
# install the prerequisties
sh hack/deploy.sh --all
# verification of dapr
dapr status -k
# install openfunction
kubectl create -f https://github.com/OpenFunction/OpenFunction/releases/download/v0.4.0/bundle.yaml
# verfication
kubectl get pods --namespace openfunction
# delete openfunction
kubectl delete -f https://raw.githubusercontent.com/OpenFunction/OpenFunction/release-0.4/config/bundle.yaml
# delete the prerequisties
sh hack/delete.sh --all
REGISTRY_SERVER=https://index.docker.io/v1/
REGISTRY_USER=<your_registry_user>
REGISTRY_PASSWORD=<your_registry_password>
kubectl create secret docker-registry push-secret \
--docker-server=$REGISTRY_SERVER \
--docker-username=$REGISTRY_USER \
--docker-password=$REGISTRY_PASSWORD
cd hello-world-go
kubectl create -f hello-world-go.yaml
❯ kubectl get functions
NAME BUILDSTATE SERVINGSTATE BUILDER SERVING AGE
function-sample Created builder-6bf2s 61s
❯ kubectl get builders
NAME PHASE STATE AGE
builder-6bf2s Build Building 70s
❯ kubectl get builds
NAME REGISTERED REASON BUILDSTRATEGYKIND BUILDSTRATEGYNAME CREATIONTIME
builder-cvkrg-build-5lz4g True Succeeded ClusterBuildStrategy openfunction 16m
❯ kubectl get ClusterBuildStrategies
NAME AGE
openfunction 3h37m
❯ kubectl get buildruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
builder-pzdgk-buildrun-jrkpz Unknown Running 103s
❯ kubectl get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
builder-pzdgk-buildrun-jrkpz-8q4cx Unknown Running 108s
Once the function is built, the relative CR will be cleaned.
❯ kubectl get servings
NAME PHASE STATE AGE
serving-q9dsr Serving Running 20s
❯ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
serving-q9dsr-ksvc-77w9x http://serving-q9dsr-ksvc-77w9x.default.example.com serving-q9dsr-ksvc-77w9x-v100 serving-q9dsr-ksvc-77w9x-v100 True
kubectl port-forward --namespace kourier-system svc/kourier 8080:80
export INGRESS_HOST=localhost
export INGRESS_PORT=8080
SERVICE_NAME=serving-q9dsr-ksvc-77w9x
SERVICE_HOSTNAME=$(kubectl get ksvc $SERVICE_NAME -n default -o jsonpath='{.status.url}' | cut -d "/" -f 3)
curl -v -H "Host: $SERVICE_HOSTNAME" http://$INGRESS_HOST:$INGRESS_PORT
❯ kubectl get pods
NAME READY STATUS RESTARTS AGE
serving-q9dsr-ksvc-77w9x-v100-deployment-78f557b95b-9j66b 2/2 Running 0 28s
kubectl delete -f hello-world-go.yaml
❯ kubectl get builders
NAME PHASE STATE AGE
builder-qx8w5 Build Failed 11h
❯ kubectl get builders -o yaml
apiVersion: v1
items:
- apiVersion: core.openfunction.io/v1alpha2
kind: Builder
metadata:
creationTimestamp: "2021-11-23T14:58:29Z"
generateName: builder-
generation: 1
labels:
openfunction.io/function: hello-world-python
name: builder-qx8w5
namespace: default
ownerReferences:
- apiVersion: core.openfunction.io/v1alpha2
blockOwnerDeletion: true
controller: true
kind: Function
name: hello-world-python
uid: 9ec1a8a9-2b05-4117-a87a-c1a2e35a36f1
resourceVersion: "4232427"
uid: 9b689181-30b4-40f9-b2af-0973784abd17
spec:
builder: openfunction/builder:v1
env:
FUNC_NAME: hello_world
FUNC_SRC: main.py
FUNC_TYPE: http
image: lizzzcai/sample-python-func:v0.4.0
imageCredentials:
name: push-secret
port: 8080
srcRepo:
sourceSubPath: hello-world-python
url: https://github.com/lizzzcai/openfunction-samples.git
status:
phase: Build
resourceRef:
shipwright.io/build: builder-qx8w5-build-mn97k
shipwright.io/buildRun: builder-qx8w5-buildrun-x6q7b
state: Failed
kind: List
metadata:
resourceVersion: ""
selfLink: ""
❯ kubectl get build
NAME REGISTERED REASON BUILDSTRATEGYKIND BUILDSTRATEGYNAME CREATIONTIME
builder-qx8w5-build-mn97k True Succeeded ClusterBuildStrategy openfunction 11h
❯ kubectl get buildrun
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
builder-qx8w5-buildrun-x6q7b False Failed 11h 11h
❯ kubectl get buildrun -o yaml
apiVersion: v1
items:
- apiVersion: shipwright.io/v1alpha1
kind: BuildRun
metadata:
creationTimestamp: "2021-11-23T14:58:29Z"
generateName: builder-qx8w5-buildrun-
generation: 1
labels:
build.shipwright.io/generation: "1"
build.shipwright.io/name: builder-qx8w5-build-mn97k
openfunction.io/builder: builder-qx8w5
name: builder-qx8w5-buildrun-x6q7b
namespace: default
ownerReferences:
- apiVersion: core.openfunction.io/v1alpha2
blockOwnerDeletion: true
controller: true
kind: Builder
name: builder-qx8w5
uid: 9b689181-30b4-40f9-b2af-0973784abd17
resourceVersion: "4232426"
uid: b6309378-c55b-4ff3-b514-b410d6a42b29
spec:
buildRef:
name: builder-qx8w5-build-mn97k
status:
buildSpec:
builder:
image: openfunction/builder:v1
output:
credentials:
name: push-secret
image: lizzzcai/sample-python-func:v0.4.0
paramValues:
- name: APP_IMAGE
value: lizzzcai/sample-python-func:v0.4.0
- name: ENV_VARS
value: FUNC_NAME=hello_world#FUNC_SRC=main.py#FUNC_TYPE=http#PORT=8080
source:
contextDir: hello-world-python
url: https://github.com/lizzzcai/openfunction-samples.git
strategy:
kind: ClusterBuildStrategy
name: openfunction
completionTime: "2021-11-23T14:58:47Z"
conditions:
- lastTransitionTime: "2021-11-23T14:58:48Z"
message: 'buildrun step step-create failed in pod builder-qx8w5-buildrun-x6q7b-bnbl6-pod-l4kwf,
for detailed information: kubectl --namespace default logs builder-qx8w5-buildrun-x6q7b-bnbl6-pod-l4kwf
--container=step-create'
reason: Failed
status: "False"
type: Succeeded
failedAt:
container: step-create
pod: builder-qx8w5-buildrun-x6q7b-bnbl6-pod-l4kwf
latestTaskRunRef: builder-qx8w5-buildrun-x6q7b-bnbl6
startTime: "2021-11-23T14:58:30Z"
kind: List
metadata:
resourceVersion: ""
selfLink: ""
❯ kubectl --namespace default logs builder-qx8w5-buildrun-x6q7b-bnbl6-pod-l4kwf --container=step-create
===> DETECTING
======== Error: [email protected] ========
chdir /workspace/source/hello-world-python: no such file or directory
======== Error: [email protected] ========
chdir /workspace/source/hello-world-python: no such file or directory
...
❯ kubectl get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
builder-qx8w5-buildrun-x6q7b-bnbl6 False Failed 11h 11h
Install the latest release of Tekton Dashboard
kubectl apply --filename https://github.com/tektoncd/dashboard/releases/latest/download/tekton-dashboard-release.yaml
Set up port forwarding with Tekton Dashboard
kubectl --namespace tekton-pipelines port-forward svc/tekton-dashboard 9097:9097
Once set up, the dashboard is available in the browser under the address http://localhost:9097.