From d85bd0654472fa96aeb266677c8c455eb66e7318 Mon Sep 17 00:00:00 2001 From: Ara Pulido Date: Tue, 29 Aug 2017 11:03:28 +0200 Subject: [PATCH] Fixed Kubeless documentation based on feedback --- .../kubeless/cli-reference/deploy.md | 7 ++- docs/providers/kubeless/cli-reference/logs.md | 2 +- docs/providers/kubeless/guide/debugging.md | 16 +---- docs/providers/kubeless/guide/installation.md | 59 +------------------ 4 files changed, 9 insertions(+), 75 deletions(-) diff --git a/docs/providers/kubeless/cli-reference/deploy.md b/docs/providers/kubeless/cli-reference/deploy.md index 202a8913d5f..0689dad14e5 100644 --- a/docs/providers/kubeless/cli-reference/deploy.md +++ b/docs/providers/kubeless/cli-reference/deploy.md @@ -14,7 +14,7 @@ layout: Doc The `sls deploy` command deploys your entire service via the Kubeless API. Run this command when you have made service changes (i.e., you edited `serverless.yml`). -Use `serverless deploy function -f my-function` when you have made code changes and you want to quickly upload your updated code to your Kubernetes cluster or when you want to deploy just a function of your Serverless service. +Use `serverless deploy function -f my-function` when you have made code changes and you want to quickly upload your updated code to your Kubernetes cluster. ```bash serverless deploy @@ -23,9 +23,10 @@ serverless deploy This is the simplest deployment usage possible. With this command Serverless will deploy your service to the default Kubernetes cluster in your kubeconfig file. ## Options -- `--noDeploy` or `-n` Skips the deployment steps and leaves artifacts in the `.serverless` directory +- `--noDeploy` or `-n` Skips the deployment steps and leaves artifacts in the `.serverless` directory. - `--verbose` or `-v` Shows all stack events during deployment, and display any Stack Output. -- `--function` or `-f` The name of the function which should be deployed +- `--function` or `-f` The name of the function which should be updated. +- `--package` or `-p` The path of a previously packaged deployment to get deployed (skips packaging step). ## Artifacts diff --git a/docs/providers/kubeless/cli-reference/logs.md b/docs/providers/kubeless/cli-reference/logs.md index 29d620d0ac3..a6eeeb6fc7e 100644 --- a/docs/providers/kubeless/cli-reference/logs.md +++ b/docs/providers/kubeless/cli-reference/logs.md @@ -47,7 +47,7 @@ serverless logs -f hello - `--filter` You can specify a filter string to filter the log output. This is useful if you want to to get the `error` logs for example. - `--tail` or `-t` You can optionally tail the logs and keep listening for new logs in your terminal session by passing this option. -- `--interval` or `-i` If you choose to tail the output, you can control the interval at which the framework polls the logs with this option. The default is `1000`ms. +- `--count` or `-n` You can print the last N lines of the log. ## Examples diff --git a/docs/providers/kubeless/guide/debugging.md b/docs/providers/kubeless/guide/debugging.md index 8e58324b660..1822efdeeac 100644 --- a/docs/providers/kubeless/guide/debugging.md +++ b/docs/providers/kubeless/guide/debugging.md @@ -104,20 +104,10 @@ Serverless: Calling function: bikesearch... Serverless Version: 1.20.2 ``` -Serverless returned an error message with a 500 server code, which is what you would expect from a web framework. However, it would be useful to see Python stack trace to better debug the source of the error. To achieve this, first find the container where the function is running using *kubectl*: +Serverless returned an error message with a 500 server code, which is what you would expect from a web framework. However, it would be useful to see Python stack trace to better debug the source of the error. This can be done using the `logs` feature in `serverless`: ``` -kubectl get pods - -# Output -NAME READY STATUS RESTARTS AGE -bikesearch-3894699941-mbt2t 1/1 Running 1 2d -``` - -Once the name of the container is known, use *kubectl logs* to check the logs: - -``` -kubectl logs bikesearch-3894699941-mbt2t +serverless logs -f bikesearch # Output Bottle v0.12.13 server starting up (using CherryPyServer())... @@ -161,4 +151,4 @@ KeyError: 'term' It should be clear from the second-to-last line that the error originates in an incorrect key name. -This is a very basic example of debugging a Kubeless function, but it should hopefully highlight the basic principles. Obviously, in production environments, you would want to have more formal and sophisticated error handling built into your code. \ No newline at end of file +This is a very basic example of debugging a Kubeless function, but it should hopefully highlight the basic principles. Obviously, in production environments, you would want to have more formal and sophisticated error handling built into your code. diff --git a/docs/providers/kubeless/guide/installation.md b/docs/providers/kubeless/guide/installation.md index 19eed289224..c1a1a181a52 100644 --- a/docs/providers/kubeless/guide/installation.md +++ b/docs/providers/kubeless/guide/installation.md @@ -16,57 +16,7 @@ layout: Doc Kubeless runs on [Kubernetes](https://kubernetes.io), you need a working Kubernetes cluster to run kubeless. For testing you can use [minikube](https://github.com/kubernetes/minikube). -You should deploy Kubeless in your cluster using one of YAML manifests found in the release package. It will create a *kubeless* Namespace and a *function* ThirdPartyResource. You will see a *kubeless* Controller, and *kafka*, *zookeeper* StatefulSet running. - -There are several kubeless manifests being shipped for multiple k8s environments (non-rbac and rbac), please consider to pick up the correct one: - -* *kubeless-$RELEASE.yaml* is used for non-RBAC Kubernetes cluster. -* *kubeless-rbac-$RELEASE.yaml* is used for RBAC-enabled Kubernetes cluster. - -For example, this below is a show case of deploying kubeless to a non-RBAC Kubernetes cluster. - - $ export RELEASE=0.0.20 - $ kubectl create ns kubeless - $ kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml - - $ kubectl get pods -n kubeless - NAME READY STATUS RESTARTS AGE - kafka-0 1/1 Running 0 1m - kubeless-controller-3331951411-d60km 1/1 Running 0 1m - zoo-0 1/1 Running 0 1m - - $ kubectl get deployment -n kubeless - NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE - kubeless-controller 1 1 1 1 1m - - $ kubectl get statefulset -n kubeless - NAME DESIRED CURRENT AGE - kafka 1 1 1m - zoo 1 1 1m - - $ kubectl get thirdpartyresource - NAME DESCRIPTION VERSION(S) - function.k8s.io Kubeless: Serverless framework for Kubernetes v1 - - $ kubectl get functions - -## Installing the Kubeless CLI (optional) - -You can optionally install the Kubeless CLI tool. - -On Linux, use these commands to install Kubeless CLI in your system: - - $ curl -L https://github.com/kubeless/kubeless/releases/download/0.0.20/kubeless_linux-amd64.zip > kubeless.zip - $ unzip kubeless.zip - $ sudo cp bundles/kubeless_linux-amd64/kubeless /usr/local/bin/ - -On Mac OS X, use these commands to install Kubeless CLI in your system: - - $ curl -L https://github.com/kubeless/kubeless/releases/download/0.0.20/kubeless_darwin-amd64.zip > kubeless.zip - $ unzip kubeless.zip - $ sudo cp bundles/kubeless_darwin-amd64/kubeless /usr/local/bin/ - -| TIP: For detailed installation instructions, visit the [Kubeless releases page](https://github.com/bitnami/kubeless/releases). +Once you have a working Kubernetes cluster, you need to install the Kubeless Controller in it. To do this, follow the [installation instructions in the Kubeless README.md file](https://github.com/kubeless/kubeless#installation). ## Installing Node.js @@ -100,10 +50,3 @@ To see which version of serverless you have installed run: serverless --version ``` -## Installing Kubeless Provider Plugin - -Now we need to install the provider plugin to allow the framework to deploy services to the platform. This plugin is also [published](http://npmjs.com/package/serverless-kubeless) on [npm](https://npmjs.org) and can installed using the same `npm install` command. - -``` -npm install -g serverless-kubeless -```