Felixnoo / cli

A CLI for interacting with OpenFunction.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenFunctionCtl

cli is the Command-Line Interface for OpenFunction

The cli repo is used to track issues for the OpenFunction. this tool allows users to focus on the core functionality of the OpenFunction, while also presenting the relationship between the OpenFunction and its dependent components in a more abstract and friendly way to the user.

Main commands

The main commands supported by the CLI are:

  • init: provides management for openfunction’s framework.
  • install: install OpenFunction and its dependencies.
  • uninstall: uninstall OpenFunction and its dependencies.
  • create: create a function from a file or stdin.
  • apply: apply a function from a file or stdin.
  • get: prints a table of the most important information about the specified function.
    • get builder: prints important information about the builder.
    • get serving:prints important information about the serving.
  • delete: delete a specified the function.

Getting started

Visit ofn release to select the ofn cli to deploy to your cluster.

Use ofn to deploy OpenFunction

We assume that you have placed the artifacts from the above step under the appropriate path in PATH and renamed it ofn.

You can use the ofn install --all to complete a simple deployment. By default, this command will install the v0.4.0 version of OpenFunction for you, while it will skip the installation process for components that already exist (you can use the --upgrade command to overwrite these components).

Please refer to the ofn install docs.

# ofn install --all --upgrade
Start installing OpenFunction and its dependencies.
Here are the components and corresponding versions to be installed:
+------------------+---------+
| COMPONENT        | VERSION |
+------------------+---------+
| Kourier          | 1.0.1   |
| Keda             | 2.4.0   |
| Tekton Pipelines | 0.30.0  |
| OpenFunction     | 0.4.0   |
| Dapr             | 1.5.1   |
| CertManager      | 1.1.0   |
| Shipwright       | 0.6.1   |
| Knative Serving  | 1.0.1   |
| DefaultDomain    | 1.0.1   |
+------------------+---------+
You have used the `--upgrade` parameter, which means that the installation process will overwrite the components that already exist.
Make sure you know what happens when you do this.
Enter 'y' to continue and 'n' to abort:
-> y
πŸ”„  -> INGRESS <- Installing Ingress...
πŸ”„  -> KNATIVE <- Installing Knative Serving...
πŸ”„  -> DAPR <- Installing Dapr...
πŸ”„  -> DAPR <- Downloading Dapr Cli binary...
πŸ”„  -> KEDA <- Installing Keda...
πŸ”„  -> CERTMANAGER <- Installing Cert Manager...
πŸ”„  -> SHIPWRIGHT <- Installing Shipwright...
πŸ”„  -> INGRESS <- Checking if Ingress is ready...
πŸ”„  -> KEDA <- Checking if Keda is ready...
πŸ”„  -> CERTMANAGER <- Checking if Cert Manager is ready...
πŸ”„  -> SHIPWRIGHT <- Checking if Shipwright is ready...
πŸ”„  -> KNATIVE <- Installing Kourier as Knative's gateway...
πŸ”„  -> KNATIVE <- Configuring Knative Serving's DNS...
πŸ”„  -> KNATIVE <- Checking if Knative Serving is ready...
βœ…  -> CERTMANAGER <- Done!
πŸ”„  -> DAPR <- Initializing Dapr with Kubernetes mode...
βœ…  -> SHIPWRIGHT <- Done!
βœ…  -> KNATIVE <- Done!
βœ…  -> INGRESS <- Done!
βœ…  -> DAPR <- Done!
βœ…  -> KEDA <- Done!
πŸ”„  -> OPENFUNCTION <- Installing OpenFunction...
πŸ”„  -> OPENFUNCTION <- Checking if OpenFunction is ready...
βœ…  -> OPENFUNCTION <- Done!
πŸš€ Completed in 2m3.638035129s.

Use ofn to uninstall OpenFunction

We assume that you have placed the artifacts from the above step under the appropriate path in PATH and renamed it ofn.

You can use ofn uninstall --all to easily uninstall OpenFunction and its dependencies (or just uninstall OpenFunction without arguments).

Please refer to the ofn uninstall docs.

~# ofn uninstall --all
Start uninstalling OpenFunction and its dependencies.
The following components already exist:
+------------------+---------+
| COMPONENT        | VERSION |
+------------------+---------+
| Cert Manager     | v1.5.4  |
| Ingress Nginx    | 1.1.0   |
| Tekton Pipelines | v0.28.1 |
| Shipwright       | 0.6.0   |
| OpenFunction     | v0.4.0  |
| Dapr             | 1.4.3   |
| Keda             | 2.4.0   |
| Knative Serving  | 0.26.0  |
+------------------+---------+
You can see the list of components to be uninstalled and the list of components already exist in the cluster.
Make sure you know what happens when you do this.
Enter 'y' to continue and 'n' to abort:
-> y
πŸ”„  -> OPENFUNCTION <- Uninstalling OpenFunction...
πŸ”„  -> KNATIVE <- Uninstalling Knative Serving...
πŸ”„  -> DAPR <- Uninstalling Dapr with Kubernetes mode...
πŸ”„  -> KEDA <- Uninstalling Keda...
πŸ”„  -> SHIPWRIGHT <- Uninstalling Tekton Pipeline & Shipwright...
πŸ”„  -> INGRESS <- Uninstalling Ingress...
πŸ”„  -> CERTMANAGER <- Uninstalling Cert Manager...
βœ…  -> OPENFUNCTION <- Done!
βœ…  -> DAPR <- Done!
πŸ”„  -> KNATIVE <- Uninstalling Kourier...
βœ…  -> KEDA <- Done!
βœ…  -> CERTMANAGER <- Done!
βœ…  -> KNATIVE <- Done!
βœ…  -> INGRESS <- Done!
βœ…  -> SHIPWRIGHT <- Done!
πŸš€ Completed in 1m21.683329262s.

Build OpenFunction CLI

You can also use make build to build the OpenFunction CLI β€”β€” ofn. When the command is executed, you can find the artifact in the . /dist directory. Move it to the appropriate path in the PATH so that you can use it in your environment.

~# make build
go fmt ./...
/opt/openfunction/fn-cli/bin/goimports -w cmd/ pkg/ testdata/
go vet ./...
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build  -ldflags "-s -w -X 'main.goversion=go version go1.16.7 linux/amd64'" \
-o ./dist/fn_linux_amd64 cmd/main.go;

About

A CLI for interacting with OpenFunction.

License:Apache License 2.0


Languages

Language:Go 98.2%Language:Makefile 1.8%