Skip to content
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

[WIP] Adds openfaas operator addon #630

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

afzalbin64
Copy link
Contributor

@afzalbin64 afzalbin64 commented Feb 7, 2023

Description of your changes

Fixes #5056

How has this code been tested?

Checklist

I have:

  • Title of the PR starts with type (e.g. [Addon] , [example] or [Doc]).
  • Updated/Added any relevant documentation and examples.
  • New addon should be put in experimental.
  • Update addon should modify the version in metadata.yaml to generate a new version.

Verified Addon promotion rules

If this pr wants to promote an experimental addon to verified, you must check whether meet these conditions too:

  • This addon must be tested by addon's e2e-test to guarantee this addon can be enabled successfully.
  • This addon must have some basic but necessary information.
    • An accessible icon url and source url defined in addon's metadata.yaml.
    • A detail introduction include a basic example about how to use and what's the benefit of this addon in README.md.
    • Also provide an introduction in KubeVela documentation.
    • It's more likely to be accepted if useful examples provided in example dir.

@wangyikewxgm
Copy link
Collaborator

Hi @afzalbin64, is this pr still in progress?

@afzal442
Copy link
Contributor

Hello @wangyikewxgm! You can review it up till what I did. Also, LMK how I can find resources to write its template for openfaas operator definitions and generate its example. Thanks. Although I found this doc, it is limited one. 😉

@afzal442
Copy link
Contributor

Hi @wangyikewxgm ! I just found this docs where I got to know how to go further. https://kubevela.io/docs/platform-engineers/components/custom-component. I had been waiting for you. Thanks

eg vela def init stateless -t component --template-yaml ./stateless.yaml -o stateless.cue

@wangyikewxgm
Copy link
Collaborator

I apologize for the delayed reply. First, you can review the primary CRD in this Helm chart and manually create it by writing a native CRD YAML file. Next, you can follow this documentation to write a CUE template in the definition and generate a CRD using KubeVela.

Also, I highly recommend taking a look at this informative guide on how to create a workload in OpenFaaS, which can be found here. By gaining a deeper understanding of OpenFaaS, you can then create the add-on.

@afzal442
Copy link
Contributor

afzal442 commented Apr 21, 2023

Hi there, if I try to use type helm, would it be sufficient to use it for Function custom resource?
the updated template.yaml would be like

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: openfaas-operator
  namespace: openfaas-sys
spec:
  components:
  - name: openfaas-required
      type: k8s-objects # Set to k8s-objects
      properties:
        objects:
          - apiVersion: v1
            kind: Namespace
            metadata:
              name: openfaas
          - apiVersion: v1
            kind: Namespace
            metadata:
              name: openfaas-fn
    - name: openfaas-operator
      type: helm
      properties:
        chart: openfaas
        version: 0.16.4
        repoType: helm
        url: https://openfaas.github.io/faas-netes
        releaseName: my-openfaas
        targetNamespace: openfaas
        values:
            ingress.enabled: true

Ref: https://github.com/openfaas/faas-netes/blob/master/chart/openfaas/README.md
https://www.openfaas.com/blog/howto-package-functions-with-helm/
cc @barnettZQG

@afzalbin64 afzalbin64 marked this pull request as ready for review April 21, 2023 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] make openfaas as an addon
3 participants