A CLI utility helper for creating Kusk Gateway API resources from your OpenAPI specification document.
Flag | Description | Required? |
---|---|---|
--name |
the name to give the API resource e.g. --name my-api | ✅ |
--namespace / -n |
the namespace of the API resource e.g. --namespace my-namespace, -n my-namespace (default: default) | ❌ |
--in / -i |
file path or URL to OpenAPI spec file to generate mappings from. e.g. --in apispec.yaml | ✅ |
--upstream.service |
name of upstream Kubernetes service | ✅ |
--upstream.namespace |
namespace of upstream service (default: default) | ✅ |
--upstream.port |
port that upstream service is exposed on (default: 80) | ✅ |
Take a look at the http-bin example spec
kgw api generate -i ./examples/httpbin-spec.yaml --name httpbin-api --upstream.service httpbin --upstream.port 8080
The output should contain the following x-kusk extension at the top level
...
x-kusk:
cors: {}
path:
rewrite:
pattern: ""
substitution: ""
upstream:
service:
name: httpbin
namespace: default
port: 8080
brew install kubeshop/kusk/kgw
go install github.com/kubeshop/kgw@latest
To install a particular version: replace latest
with the version number
You can get a list of the available kgw versions from our releases page
This will install kgw
into /usr/local/bin/kgw
bash < <(curl -sSLf https://raw.githubusercontent.com/kubeshop/kgw/main/scripts/install.sh)
git clone [email protected]:kubeshop/kgw.git && \
cd kgw && \
go install
If you don't like automatic scripts you can always use the manual install:
- Download binary with version of your choice (recent one is recommended)
- Upack it (tar -zxvf kgw_0.1.0_Linux_arm64.tar.gz)
- Move it to a location in the PATH. For example
mv kgw_0.1.0_Linux_arm64/kgw /usr/local/bin/kgw
For Windows, download the binary from here, unpack the binary and add it to %PATH%
.
brew upgrade kubeshop/kusk/kgw
go install github.com/kubeshop/kgw@$VERSION
Insde of the kgw repository directory
git pull && go install
Your contributions are always welcome! Please have a look at the contribution guidelines first.