openfaas / openfaas/faas-cli

Add Rio to faas-cli generate

Open
#640 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help wanted size/xs
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

Expected Behaviour

The following should generate a Rancher Rio Service definition:

faas-cli generate --api=services.rio.cattle.io
apiVersion: rio.cattle.io/v1
kind: Service
metadata:
  name: figlet
  namespace: default
spec:
  concurrency: 10
  cpus: "0"
  env:
  - name: a
    value: b
  image: functions/figlet:latest
  imagePullPolicy: IfNotPresent
  maxScale: 1
  minScale: 1
  ports:
  - port: 8080
    protocol: HTTP
    targetPort: 8080
  rollout: true
  rolloutIncrement: 5
  rolloutInterval: 5
  scale: 1
  weight: 100

Current Behaviour

We have OpenFaaS CRD and Knative Serving CRD in place. I'd like to see the Rio CRD there next.

Possible Solution

Copy the approach used for the current generation as per: https://github.com/openfaas/faas-cli/blob/master/commands/generate.go#L164

Set all default / minimum needed to get a service running.

  • Install K8s somewhere
  • Install Rio - https://github.com/rancher/rio
  • Try kubectl apply for the sample YAML above
  • Next update the faas-cli code to generate Service YAML

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in commands/generate.go around line 164 and review the existing CRD generation approach. Install Kubernetes and Rio, then apply the sample YAML to verify the required Service fields. Done means faas-cli generate --api=services.rio.cattle.io produces the shown Rio Service definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.