Skip to content

Commit

Permalink
rename kusk references to kusk-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Hodgetts committed Apr 19, 2022
1 parent 88bbff2 commit 8784bb9
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

var (
rootCmd = &cobra.Command{
Use: "kusk",
Use: "kusk-gen",
Short: "Framework that makes an OpenAPI definition the source of truth for all API-related objects in a cluster (services, mappings, monitors, etc)",
}
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func init() {
versionCmd := &cobra.Command{
Use: "version",
Short: "Prints kusk version info",
Short: "Prints kusk-gen version info",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s\n", version.Version)
fmt.Printf("Git SHA: %s\n", version.Commit)
Expand Down
20 changes: 10 additions & 10 deletions docs/ambassador.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Ambassador uses `CustomResourceDefinition`s with `apiVersion` = `apiextensions.k8s.io/v1beta1` which was removed in Kubernetes version 1.22+. Please ensure your Kubernetes version is compatible with the version of Ambassador you're using

```shell
kusk ambassador --help
kusk-gen ambassador --help
Generates Ambassador Mappings for your service

Usage:
kusk ambassador [flags]
kusk-gen ambassador [flags]

Flags:
-i, --in string file path to api spec file to generate mappings from. e.g. --in apispec.yaml
Expand Down Expand Up @@ -59,7 +59,7 @@ To override settings on the path or HTTP method level, you are required to use t
### CLI Flags

```shell
kusk ambassador -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -99,13 +99,13 @@ spec:
## Split Path
By setting split path to true, kusk will generate a mapping per route specified in the
By setting split path to true, kusk-gen will generate a mapping per route specified in the
provided OpenAPI specification
### CLI Flags
```shell
kusk ambassador -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -171,7 +171,7 @@ request onto the service.
### CLI Flags
```shell
kusk ambassador -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -218,12 +218,12 @@ spec:
## Setting timeouts
kusk allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension
kusk-gen allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension
### CLI Flags
```shell
kusk ambassador -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -270,12 +270,12 @@ spec:
## Setting the Host header
kusk allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension
kusk-gen allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension
### CLI Flags
```shell
kusk ambassador -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down
16 changes: 8 additions & 8 deletions docs/ambassador2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Ambassador2 uses `CustomResourceDefinition`s with `apiVersion` = `apiextensions.


```shell
kusk ambassador2 --help
kusk-gen ambassador2 --help
Generates Ambassador 2.0 Mappings for your service

Usage:
Expand Down Expand Up @@ -139,7 +139,7 @@ kubectl rollout status -n booksapp deployment/webapp -w
### CLI Flags

```shell
kusk ambassador2 -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador2 -i examples/booksapp/booksapp.yaml \
--namespace booksapp \
--host "*" \
--service.name webapp \
Expand Down Expand Up @@ -194,7 +194,7 @@ provided OpenAPI specification
### CLI Flags

```shell
kusk ambassador2 -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador2 -i examples/booksapp/booksapp.yaml \
--namespace booksapp \
--host "*" \
--service.name webapp \
Expand Down Expand Up @@ -271,7 +271,7 @@ request onto the service.
### CLI Flags

```shell
kusk ambassador2 -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador2 -i examples/booksapp/booksapp.yaml \
--namespace booksapp \
--host "*" \
--service.name webapp \
Expand Down Expand Up @@ -341,7 +341,7 @@ When no rewrite or trim prefix is specified, the rewrite option will default to
### CLI Flags

```shell
kusk ambassador2 -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador2 -i examples/booksapp/booksapp.yaml \
--namespace booksapp \
--host "*" \
--service.name webapp \
Expand Down Expand Up @@ -396,12 +396,12 @@ Or go to your web browser

## Setting timeouts

kusk allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension
kusk-gen allows for setting both idle and request timeouts via flags or the x-kusk OpenAPI extension

### CLI Flags

```shell
kusk ambassador2 -i examples/booksapp/booksapp.yaml \
kusk-gen ambassador2 -i examples/booksapp/booksapp.yaml \
--namespace booksapp \
--host "*" \
--service.name booksapp \
Expand Down Expand Up @@ -453,7 +453,7 @@ spec:

Via the x-kusk extension, you can set cors policies on your resources

kusk ambassador2 -i examples/booksapp/booksapp_extension.yaml
kusk-gen ambassador2 -i examples/booksapp/booksapp_extension.yaml

Here we only set the `-i` input flag as the other mandatory options have been set using
the `x-kusk` extension in the OpenAPI spec file.
Expand Down
24 changes: 12 additions & 12 deletions docs/argocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ We will add an `initContainer` to `argocd-repo-server` and a volume to download
weight: 5
automountServiceAccountToken: false
+ initContainers:
+ - name: download-kusk
+ - name: download-kusk-gen
+ image: alpine:3.8
+ command: [ sh, -c ]
+ args:
+ - wget -qO- https://github.com/kubeshop/kusk-gen/releases/latest/download/kusk-gen_Linux_arm64.tar.gz | tar -xvzf - &&
+ mv kusk /custom-tools/
+ volumeMounts:
+ - mountPath: /custom-tools
+ name: kusk
+ name: kusk-gen
containers:
- command:
- uid_entrypoint.sh
@@ -72,7 +82,12 @@ spec:
name: gpg-keyring
- mountPath: /app/config/reposerver/tls
name: argocd-repo-server-tls
+ - mountPath: /usr/local/bin/kusk
+ name: kusk
+ subPath: kusk
+ - mountPath: /usr/local/bin/kusk-gen
+ name: kusk-gen
+ subPath: kusk-gen
volumes:
+ - name: kusk
+ - name: kusk-gen
+ emptyDir: {}
- configMap:
name: argocd-ssh-known-hosts-cm
Expand All @@ -66,25 +66,25 @@ When installed, Kusk binary will be available during ArgoCD sync. To use that, w
name: argocd-cm
+data:
+ configManagementPlugins: |
+ - name: kusk
+ - name: kusk-gen
+ generate:
+ command: ["/bin/sh", "-c"]
+ args: ["kusk $KUSK_GENERATOR -i $KUSK_INPUT $KUSK_ARGS"]
+ args: ["kusk-gen $KUSK_GENERATOR -i $KUSK_INPUT $KUSK_ARGS"]
```

Once these changes are applied to your ArgoCD installation, you can begin to use Kusk!

## Use Kusk in ArgoCD UI
## Use kusk-gen in ArgoCD UI
When you are [creating an App via UI](https://argoproj.github.io/argo-cd/getting_started/#creating-apps-via-ui), scroll down and select "Plugin" as a configuration management tool:
![image](https://user-images.githubusercontent.com/14029650/129340017-04ef2221-1793-4087-bf95-d60b1f2900d4.png)

After that, select Kusk as a plugin and fill the environment variables to specify the generator you want to invoke and the input file with your OpenAPI schema:
After that, select kusk-gen as a plugin and fill the environment variables to specify the generator you want to invoke and the input file with your OpenAPI schema:
![image](https://user-images.githubusercontent.com/14029650/129340227-d729cb61-7c28-4869-80dd-9cea7153cfbd.png)

ArgoCD will sync your app and you will be able to see resources generated and applied to your cluster automatically 🪄:
![image](https://user-images.githubusercontent.com/14029650/129340502-e469fd2e-d745-483e-ba11-954dcc5c3ab2.png)

## Use Kusk in ArgoCD CLI
## Use kusk-gen in ArgoCD CLI
It is also possible to [create an App via CLI](https://argoproj.github.io/argo-cd/getting_started/#creating-apps-via-cli) with Kusk - just specify `--config-management-plugin kusk` option:
```shell
argocd app create petstore-kusk \
Expand All @@ -97,7 +97,7 @@ argocd app create petstore-kusk \
--dest-namespace default
```

## Use Kusk in ArgoCD App manifest
## Use kusk-gen in ArgoCD App manifest
In ArgoCD it is possible to manage applications using App manifest and apply them using `kubectl`: [documentation](https://argoproj.github.io/argo-cd/operator-manual/declarative-setup/).
To use Kusk in this setup, add Kusk in a `plugin` node:
```yaml
Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Installing Kusk

### Homebrew
`brew install kubeshop/kusk/kusk`
`brew install kubeshop/kusk/kusk-gen`

### Latest release on Github
`go install github.com/kubeshop/kusk-gen@$VERSION`
Expand All @@ -14,22 +14,22 @@ Download it and unpack *kusk* to the directory of you choice.

### From source
```shell
git clone [email protected]:kubeshop/kusk.git && \
cd kusk && \
git clone [email protected]:kubeshop/kusk-gen.git && \
cd kusk-gen && \
go install
```

## Usage

For a run-through of what Kusk can do with the tools already installed in your cluster run:
`kusk wizard -i my-openapi-spec.yaml`
For a run-through of what kusk-gen can do with the tools already installed in your cluster run:
`kusk-gen wizard -i my-openapi-spec.yaml`

Or use one of our examples
`kusk wizard -i examples/booksapp/booksapp.yaml`
`kusk-gen wizard -i examples/booksapp/booksapp.yaml`

```shell
Usage:
kusk [command]
kusk-gen [command]

Available Commands:
ambassador Generates Ambassador Mappings for your service
Expand All @@ -43,7 +43,7 @@ Available Commands:
Flags:
-h, --help help for kusk

Use "kusk [command] --help" for more information about a command.
Use "kusk-gen [command] --help" for more information about a command.
```

For more comprehensive instructions on individual generators, please refer to the dedicated document in the docs folder
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ relate to their applications or services.
Kusk (_coachman in Swedish_) treats your OpenAPI/Swagger definition as a source of truth for generating
supplementary Kubernetes resources for your REST APIs in regard to mappings, security, traffic-control, monitoring, etc.

- The [Kusk wizard](#kusk-wizard) can inspect your cluster for the tools it supports and generate corresponding
- The [Kusk wizard](#kusk-gen-wizard) can inspect your cluster for the tools it supports and generate corresponding
resources automatically.
- the [Kusk OpenAPI extension](openapi-extension.md) allows you to specify QoS and k8s related metadata which will be used
to configure your cluster accordingly.
Expand All @@ -16,7 +16,7 @@ supplementary Kubernetes resources for your REST APIs in regard to mappings, sec

![kusk-overview](https://user-images.githubusercontent.com/14029650/129193622-b5f06b8d-845d-4b1e-adaf-34dd7b3e0108.png)

## Kusk Wizard
## kusk-gen Wizard

Kusk comes with a `kusk wizard` interactive CLI to help you get started!
kusk-gen comes with a `kusk-gen wizard` interactive CLI to help you get started!
![wizard-gif](./kusk-wizard.svg)
16 changes: 8 additions & 8 deletions docs/ingress-nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Note** This generator refers to the community ingress from [Kubernetes ingress-nginx](https://github.com/kubernetes/ingress-nginx/)

```bash
kusk ingress-nginx
kusk-gen ingress-nginx

Usage:
kusk ingress-nginx [flags]
Expand Down Expand Up @@ -57,7 +57,7 @@ To override settings on the path or HTTP method level, you are required to use t
## Basic Usage
### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -110,7 +110,7 @@ provided OpenAPI specification
### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -193,7 +193,7 @@ request onto the service.
### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -251,7 +251,7 @@ status:
## Setting the rewrite target
### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -306,7 +306,7 @@ status:
## Setting the Host
### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -357,15 +357,15 @@ status:
```
## Setting timeouts
kusk allows for setting a request timeout via flags or the x-kusk OpenAPI extension
kusk-gen allows for setting a request timeout via flags or the x-kusk OpenAPI extension
The ingress-nginx generator will spread the total request time over the following settings, diving it by 2
- `nginx.ingress.kubernetes.io/proxy-send-timeout`
- `nginx.ingress.kubernetes.io/proxy-read-timeout`

### CLI Flags
```shell
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
kusk-gen ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down
Loading

0 comments on commit 8784bb9

Please sign in to comment.