Giter Site home page Giter Site logo

Comments (11)

Art3mK avatar Art3mK commented on September 26, 2024 1

ok, looks like it's latest docker image from github doesn't have darwin/arm64, I guess that's why it can't start that image in container. I wasn't able to build docker images locally for that arch, but I was able to build function with go, so I can play locally 👍

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024 1

ah, so it was just non existing user in the image? crossplane beta render works now with the docker image 👍 I guess using USER 1000:1000 instead of non-root should be fine as well.

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024 1

yeah, with docker image that finally works, thank you!

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024

@Peefy any idea how to try that in actual cluster?

➜  k get functions kcl-function -o yaml
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"pkg.crossplane.io/v1beta1","kind":"Function","metadata":{"annotations":{},"name":"kcl-function"},"spec":{"package":"kcllang/crossplane-kcl"}}
  creationTimestamp: "2024-01-19T10:10:20Z"
  generation: 1
  name: kcl-function
  resourceVersion: "2785136"
  uid: 4a280956-4c0b-491b-bad8-9a0349a7509e
spec:
  ignoreCrossplaneConstraints: false
  package: kcllang/crossplane-kcl
  packagePullPolicy: IfNotPresent
  revisionActivationPolicy: Automatic
  revisionHistoryLimit: 1
  runtimeConfigRef:
    apiVersion: pkg.crossplane.io/v1beta1
    kind: DeploymentRuntimeConfig
    name: default
  skipDependencyResolution: false
status:
  conditions:
  - lastTransitionTime: "2024-01-19T10:47:32Z"
    message: 'cannot initialize parser backend: couldn''t find "package.yaml" file
      after checking 6429 files in the archive (annotated layer: false): EOF'
    reason: UnhealthyPackageRevision
    status: "False"
    type: Healthy
  - lastTransitionTime: "2024-01-19T10:10:21Z"
    reason: ActivePackageRevision
    status: "True"
    type: Installed
  currentIdentifier: kcllang/crossplane-kcl
  currentRevision: kcl-function-e81ab068ba03

from function-kcl.

Peefy avatar Peefy commented on September 26, 2024

Can this document help you? https://kcl-lang.io/docs/user_docs/guides/working-with-k8s/mutate-manifests/crossplane-kcl-function

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024

I don't think I got anything wrong with my setup actually, but rather smth is wrong with the kcllang/crossplane-kcl docker image. Could you please check if you can get it running locally in docker image with crossplane beta render and without render.crossplane.io/runtime: Development annotation on function?

Right now I see these in events in k8s:

20m         Warning   ParsePackage              functionrevision/kcl-function-e81ab068ba03                cannot initialize parser backend: couldn't find "package.yaml" file after checking 1061 files in the archive (annotated layer: false): context deadline exceeded
17m         Warning   ParsePackage              functionrevision/kcl-function-61c608dacb13                (combined from similar events): cannot initialize parser backend: couldn't find "package.yaml" file after checking 1915 files in the archive (annotated layer: false): context deadline exceeded
17m         Warning   ParsePackage              functionrevision/kcl-function-61c608dacb13                (combined from similar events): cannot initialize parser backend: couldn't find "package.yaml" file after checking 1915 files in the archive (annotated layer: false): context deadline exceeded
11m         Warning   ParsePackage              functionrevision/kcl-function-e81ab068ba03                (combined from similar events): cannot initialize parser backend: couldn't find "package.yaml" file after checking 179 files in the archive (annotated layer: false): context deadline exceeded
11m         Warning   ParsePackage              functionrevision/kcl-function-e81ab068ba03                (combined from similar events): cannot initialize parser backend: couldn't find "package.yaml" file after checking 179 files in the archive (annotated layer: false): context deadline exceeded

I don't think that could be related to any config I have on my side?

from function-kcl.

Peefy avatar Peefy commented on September 26, 2024

My message is as follows:

$ kubectl get functions kcl-function -o yaml

apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"pkg.crossplane.io/v1beta1","kind":"Function","metadata":{"annotations":{},"name":"kcl-function"},"spec":{"package":"kcllang/crossplane-kcl"}}
  creationTimestamp: "2024-01-19T12:54:47Z"
  generation: 1
  name: kcl-function
  resourceVersion: "980"
  uid: fab2cdbf-d3f9-45be-9626-9103fa9ad36c
spec:
  ignoreCrossplaneConstraints: false
  package: kcllang/crossplane-kcl
  packagePullPolicy: IfNotPresent
  revisionActivationPolicy: Automatic
  revisionHistoryLimit: 1
  runtimeConfigRef:
    apiVersion: pkg.crossplane.io/v1beta1
    kind: DeploymentRuntimeConfig
    name: default
  skipDependencyResolution: false
status:
  conditions:
  - lastTransitionTime: "2024-01-19T12:55:02Z"
    reason: UnknownPackageRevisionHealth
    status: Unknown
    type: Healthy
  - lastTransitionTime: "2024-01-19T12:55:02Z"
    reason: ActivePackageRevision
    status: "True"
    type: Installed
  currentIdentifier: kcllang/crossplane-kcl
  currentRevision: kcl-function-e81ab068ba03

My version is

$ crossplane --version

v1.14.4

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024

I don't think it means function actually works, looks like your function Healthy status is uknown as well

status: Unknown
type: Healthy

could you check events in default namespace?

k get events --sort-by=.metadata.creationTimestamp -n default

mine function:

➜  k get functions
NAME           INSTALLED   HEALTHY   PACKAGE                  AGE
kcl-function   True        Unknown   kcllang/crossplane-kcl   114m

from function-kcl.

Peefy avatar Peefy commented on September 26, 2024

Sorry, I've pushed a new commit 2dce197 Could you pls help to build a local image to test it? I'm sorry, I currently don't have a computer ai this time.

from function-kcl.

Art3mK avatar Art3mK commented on September 26, 2024

I see you pushed docker image, but function still doesn't work in-cluster, healthy status is unknown and I see events like these:

84s         Warning   ComposeResources          xapplication/xxx-xxxxxxx-vz5kk                            cannot compose resources: cannot run Composition pipeline step "normal": cannot get gRPC client connection for Function "kcl-function": cannot determine gRPC target: active FunctionRevision "kcl-function-95373156cb4d" has an empty status.endpoint
27s         Warning   ParsePackage              functionrevision/kcl-function-95373156cb4d                cannot initialize parser backend: couldn't find "package.yaml" file after checking 6429 files in the archive (annotated layer: false): EOF

for me it seems image is missing some config, which crossplane expecting to find from it?

from function-kcl.

Peefy avatar Peefy commented on September 26, 2024

Can you try this image? docker.io/kcllang/crossplane-kcl

from function-kcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.