-
Notifications
You must be signed in to change notification settings - Fork 48
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
helloworld-go : no matches for kind "Function" in version "core.openfunction.io/v1beta1" #46
Comments
The Can you paste the contents of the |
functions-sample.yaml
and i also used official yaml , also same error occurred. my minikube version:
pods of openfunction status is :
|
Hi, @aBreaking , you should use this yaml file: https://github.com/OpenFunction/samples/blob/release-0.5/functions/Knative/hello-world-go/function-sample.yaml Note that apiVersion: core.openfunction.io/v1alpha2
kind: Function
metadata:
name: function-sample
spec:
version: "v1.0.0"
image: "openfunctiondev/sample-go-func:v0.5"
imageCredentials:
name: push-secret
port: 8080 # default to 8080
build:
builder: openfunction/builder-go:v0.4.0-1.15
env:
FUNC_NAME: "HelloWorld"
FUNC_TYPE: "http"
srcRepo:
revision: "release-0.5"
url: "https://github.com/OpenFunction/samples.git"
sourceSubPath: "functions/Knative/hello-world-go"
serving:
runtime: Knative # default to Knative
# template:
# containers:
# - name: function
# # Set imagePullPolicy if needed
# imagePullPolicy: Always |
@tpiperatgod hi , i can apply yaml successful, but the BUILDSTATE of function-sample is
describe:
Is there something wrong with my environment? thanks |
There should be an exception in the process of building the function image. Could you please paste the details of the For example: kubectl get buildruns.shipwright.io
or
kubectl describe buildruns.shipwright.io <name> |
describe:
|
If a build failed, the builder CR will be kept. Take a look at the build pod's log to find out the failure reason |
and could you pls paste the details of the |
is somewhere needs |
@benjaminhuo No pods found related to ofn in default namespace, need i paste the log of pods which in the namespace shipwright-build or openfunction ? |
Can you paste the information about the inventory of components in the current cluster? The inventory file is located in the ~# cat ~/.ofn/[email protected]
openFunction: 0.5.0
knativeServing: 1.0.1
kourier: 1.0.1
defaultDomain: 1.0.1
keda: 2.4.0
dapr: 1.5.1
tektonPipelines: 0.30.0
shipwright: 0.6.1
certManager: 1.5.4
ingress: 1.1.0 And can you paste the information of the ~# kubectl get clusterbuildstrategies.shipwright.io openfunction -oyaml
apiVersion: shipwright.io/v1alpha1
kind: ClusterBuildStrategy
metadata:
creationTimestamp: "2022-02-10T10:43:20Z"
generation: 1
name: openfunction
resourceVersion: "37337408"
uid: f17ca6b6-49e7-4da4-b25f-2646f8fd824e
spec:
buildSteps:
- args:
- -c
- |
#!/usr/bin/env bash
set -e
for path in "/cache" "/tekton/home" "/layers" "/workspace/source"; do
echo "> Setting permissions on '$path'..."
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$path"
done
echo "> Processing any environment variables..."
ENV_DIR="/platform/env"
echo "--> Creating 'env' directory: $ENV_DIR"
mkdir -p "$ENV_DIR"
envs=(`echo $(params.ENV_VARS) | tr '#' ' '`)
for env in "${envs[@]}"; do
IFS='=' read -r key value string <<< "$env"
if [[ "$key" != "" && "$value" != "" ]]; then
path="${ENV_DIR}/${key}"
echo "--> Writing ${path}..."
echo -n "$value" > "$path"
fi
done
command:
- /usr/local/bin/bash
image: docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
name: prepare
securityContext:
privileged: true
volumeMounts:
- mountPath: /cache
name: cache
- mountPath: /layers
name: layers-dir
- mountPath: /platform
name: $(params.PLATFORM_DIR)
- args:
- -app=/workspace/source/$(params.CONTEXT_DIR)
- -cache-dir=/cache
- -uid=$(params.USER_ID)
- -gid=$(params.GROUP_ID)
- -layers=/layers
- -platform=/platform
- -report=/layers/report.toml
- -process-type=$(params.PROCESS_TYPE)
- -skip-restore=$(params.SKIP_RESTORE)
- -previous-image=$(params.shp-output-image)
- -run-image=$(params.RUN_IMAGE)
- $(params.shp-output-image)
command:
- /cnb/lifecycle/creator
image: $(params.BUILDER_IMAGE)
imagePullPolicy: Always
name: create
securityContext:
runAsGroup: 1000
runAsUser: 1000
volumeMounts:
- mountPath: /cache
name: cache
- mountPath: /layers
name: layers-dir
- mountPath: /platform
name: $(params.PLATFORM_DIR)
- args:
- -c
- |
#!/usr/bin/env bash
set -e
cat /layers/report.toml | grep "digest" | cut -d'"' -f2 | cut -d'"' -f2 | tr -d '\n' | tee $(results.shp-image-digest.path)
command:
- /bin/sh
image: docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
name: results
volumeMounts:
- mountPath: /layers
name: layers-dir
parameters:
- default: web
description: The default process type to set on the image.
name: PROCESS_TYPE
- default: ""
description: Reference to a run image to use.
name: RUN_IMAGE
- default: ""
description: The name of the persistent app cache image (if no cache workspace
is provided).
name: CACHE_IMAGE
- default: "false"
description: Do not write layer metadata or restore cached layers.
name: SKIP_RESTORE
- default: "1000"
description: The user ID of the builder image user.
name: USER_ID
- default: "1000"
description: The group ID of the builder image user.
name: GROUP_ID
- default: empty-dir
description: The name of the platform directory.
name: PLATFORM_DIR
- default: ""
description: Environment variables to set during _build-time_. The formate is
`key1=value1,key2=value2`.
name: ENV_VARS |
and
|
Thx @aBreaking , but I still haven't found the exact reason 😂 The components in your cluster look correct, can you delete the function and apply the following configuration? Pls let me know if this works properly... apiVersion: core.openfunction.io/v1alpha2
kind: Function
metadata:
name: function-demo
spec:
version: "v1.0.0"
image: "abreaking/sample-go-func:v0.5"
imageCredentials:
name: push-secret
port: 8080
build:
builder: openfunction/builder-go:v0.4.0-1.15
env:
FUNC_NAME: "HelloWorld"
FUNC_TYPE: "http"
srcRepo:
revision: "release-0.5"
url: "https://github.com/OpenFunction/samples.git"
sourceSubPath: "functions/Knative/hello-world-go"
serving:
runtime: Knative |
@tpiperatgod unfortunately, still the same error 😶
|
OK, while I don't know what causes this exception in your cluster, the problem occurs for the following reason: The OpenFunction controller creates the I have not had this problem so far after verifying it in my cluster, so I can't be sure what is wrong with the configuration. BUT! There is another way to get a taste of OpenFunction: you can use the See more at: https://github.com/OpenFunction/cli/blob/main/docs/demo.md |
@tpiperatgod ok , thanks very much for your time, the demo I will try it later . and let me try out shipwright-io, or maybe the issue is belongs shipwright-io. |
Hi @aBreaking , you can join our community group chat 😄 |
Deleting Shipwright and then install it using ofn could solve the problem |
following hello-world-go, when i exec command
An error occurred :
can help me?
I just completely installed ofn. and the pods of ofn components were running that i have checked.
The text was updated successfully, but these errors were encountered: