Kusk makes your OpenAPI definition the source of truth for API resources in your cluster

Kusk - use OpenAPI to configure Kubernetes

Known Vulnerabilities

What is Kusk?

Developers deploying their REST APIs in Kubernetes shouldn't have to worry about managing resources that do not directly 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.

Read the Introductory blog-post to get an overview.

kusk-overview

Quick Start

Homebrew

brew install kubeshop/kusk/kusk

Latest release on Github

go install github.com/kubeshop/kusk@$VERSION

From source

git clone [email protected]:kubeshop/kusk.git && \
cd kusk && \
go install

Read more at Getting Started

Why Kusk?

Using OpenAPI as the source-for-truth for client, servers, testing, documentation, etc. is a common approach when building microservice architectures with REST APis. Kusk extends this paradigm to also include Kubernetes configurations, allowing you to

  • Cut down on development time when deploying your REST APIs to your clusters
  • Remove the need to learn tools-specific formats and configurations
  • Easily switch between supported tools without having to learn new formats/configurations

Features

  • Kusk can inspect your cluster for the tools it supports and generate corresponding resources automatically.
  • the Kusk OpenAPI Extension allows you to specify extended QoS and k8s related metadata which will be used to configure your cluster accordingly.
  • Kusk plays nicely with both manual and automated/GitOps/CD workflows.
  • The underlying architecture makes it straight-forward to extend Kusk with new generators

Kusk currently supports (click for configuration options)

Some of the upcoming tools we'd like to support are Kong and Contour. Please don't hesitate to suggest others or contribute your own generator!

Documentation & Support

To learn more about Kusk check out the complete documentation

Join our Discord Server to ask questions, suggest ideas, etc.

How to contribute

  • Check out our Contributor Guide and Code of Conduct
  • Fork/Clone the repo and make sure you can run it as shown above
  • Check out open issues here on GitHub
  • Get in touch with the team by starting a discussion on GitHub or on our Discord Server. or open an issue of your own that you would like to contribute to the project.
  • Fly like the wind!
Owner
kubeshop
open-source accelerator-incubator focused on k8s
kubeshop
Comments
  • [Bug]: kusk uses private Kubernetes annotations

    [Bug]: kusk uses private Kubernetes annotations

    Contact Details

    No response

    What happened?

    https://kubeshop.github.io/kusk-gateway/guides/autodeploy/ shows a recommendation that readers use annotations with keys like kusk-gateway/openapi-url

    For labels and annotations, keys that don't contain a . are private and โ€œbelong toโ€ the cluster's operator. A project like Kusk should use a public annotation key such as gateway.kusk.example/openapi-url, so that it is not infringing on the cluster operator's area of responsibility.

    Version

    1.0.0 (Default)

    Relevant log output

    No response

    Code of Conduct

    • [X] I agree to follow this project's Code of Conduct
  • Kusk CLI `version` - Partially closes kubeshop/kusk-gateway#415

    Kusk CLI `version` - Partially closes kubeshop/kusk-gateway#415

    Kusk CLI version - Partially closes kubeshop/kusk-gateway#415

    Define a version command that uses value of github.com/kubeshop/kusk-gateway/pkg/build populated by ldflags:

    • github.com/kubeshop/kusk-gateway: Get latest version that includes github.com/kubeshop/kusk-gateway/pkg/build package.
    • github.com/kubeshop/kusk-gateway/pkg/build: Version variable will contain the latest tag when built.
    • TELEMETRY_TOKEN: Remove references to ldflags/build-arg that is not used.
    • .github/workflows/go.yml: Remove test-GoReleaser-build as we can just run it locally using make build-goreleaser.
    • .goreleaser.yml: Populate KuskGAMeasurementID based on secret/env.
    • .goreleaser.yml: Populate KuskGAApiSecret based on secret/env.

    Example run log

    $ make build
    Makefile:62: warning: undefined variable 'GA_ID'
    Makefile:62: warning: undefined variable 'GA_SECRET'
    go build -v -o ./kusk -ldflags="-X 'github.com/kubeshop/kusk-gateway/pkg/build.Version=v1.0.4-5-ga63345e' -X 'github.com/kubeshop/kusk-gateway/pkg/analytics.KuskGAMeasurementID=' -X 'github.com/kubeshop/kusk-gateway/pkg/analytics.KuskGAApiSecret='" ./main.go
    $ ./kusk version
    kusk version 1.0.4-5-ga63345e
    https://github.com/kubeshop/kusk/releases/latest
    $ ./kusk --version
    kusk version 1.0.4-5-ga63345e
    https://github.com/kubeshop/kusk/releases/latest
    $ ./kusk -v
    kusk version 1.0.4-5-ga63345e
    https://github.com/kubeshop/kusk/releases/latest
    

    This PR...

    Changes

    Fixes

    Checklist

    • [x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • Add auth plugin to allow interaction with cloud vendor

    Add auth plugin to allow interaction with cloud vendor

    This PR... fixes https://github.com/kubeshop/kusk-gateway/issues/424

    Changes

    Fixes

    Checklist

    • [x] tested locally
    • [x] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • add install command to install kusk gateway and other components

    add install command to install kusk gateway and other components

    Add install command to install kusk gateway and optionally: an public and private envoyfleet, the kusk gateway api and dashboard.

    This PR closes #kusk-gateway/279

    Changes

    • Add install command to install kusk gateway
    • optionally install envoy-fleets, api and dashboard

    Checklist

    • [x] tested locally
    • [x] added new dependencies
    • [x] updated the docs
    • [ ] added a test
  • Fix install URL

    Fix install URL

    The URL generated was giving a 404

    This PR trails "v" from the version

    This PR...

    Changes

    Fixes

    Checklist

    • [ x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • Allow mocking of api from url + add internal file watcher

    Allow mocking of api from url + add internal file watcher

    This PR allows users to pass a url that hosts a openapi file to mock. closes https://github.com/kubeshop/kusk-gateway/issues/555 e.g. kusk mock -i https://pastebin.com/raw/pYxbr5u1

    Changes

    • Add url parsing to check if -i argument is a url or a file path
    • add internal file watcher to handle logic of listening on various fsnotify channels

    Checklist

    • [x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • Separate handling of OpenAPI specification parsing and validating errors

    Separate handling of OpenAPI specification parsing and validating errors

    Separate handling of OpenAPI specification parsing and validating errors such that a nice error on what failed validation is returned to the user.

    This PR closes https://github.com/kubeshop/kusk-gateway/issues/556

    Changes

    • handle parsing errors and validating errors in separate blocks so appropriate errors are returned to the user

    Checklist

    • [x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test

    Example

    Given an API spec that is parseable but fails validation

    openapi: 3.1.0
    info:
      title: simple-api
      version: 0.4.0
    paths:
      /statuscode/{code}:
        get:
          x-kusk:
            upstream:
              host:
                hostname: mocktarget.apigee.net
                port: 80
          parameters:
            - name: "code"
              in: "query"
              description: "Desired response status code."
              required: true
              schema:
                type: "string"
          responses:
            "200":
              description: "Success"
    

    In the above example, the {code} path parameter is not properly specified in the parameters list

    Before

    โจฏ unable to parse openapi config: %!w(<nil>) ๐Ÿ’”

    After

    Screenshot 2022-07-21 at 15 46 44
  • Mock - search for next available port to expose mock server on

    Mock - search for next available port to expose mock server on

    Add check for next available local port to expose mock server on staring from 8080 until 65535.

    If none is available, mock returns an error.

    This allows user to spin up multiple mock servers should they desire. A --port flag can also now be specified to specify a particular port to listen on

    Checklist

    • [x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • Wait for docker image download and discard the output.

    Wait for docker image download and discard the output.

    wait for docker image download and discard the output. Before when we were closing the reader straight away, this didn't wait for the download to complete. by consuming all the output from the ImagePull reader, once there is no more content, we can be confident that the download process is complete

    This PR closes https://github.com/kubeshop/kusk-gateway/issues/552

    Checklist

    • [x] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
  • Local mocking from CLI

    Local mocking from CLI

    This PR allows users to locally mock their apis using a mock server that returns responses based on content type examples or schemas.

    If examples are specified, they are used and returned. If schemas are defined, the server will generate a response that fits the schema.

    closes #491

    Screenshot 2022-07-18 at 14 48 41

    Checklist

    • [x] tested locally
    • [x] added new dependencies
    • [x] updated the docs
    • [ ] added a test
  • Analytics: Pass `TelemetryToken` in `Makefile`

    Analytics: Pass `TelemetryToken` in `Makefile`

    Makefile

    Use LD_FLAGS to pass in TELEMETRY_TOKEN to github.com/kubeshop/kusk-gateway/pkg/analytics.TelemetryToken not github.com/kubeshop/kusk-gateway/pkg/analytics.Telemetry_Token. Also remove setting github.com/kubeshop/kusk-gateway/pkg/analytics.KuskGAMeasurementID and github.com/kubeshop/kusk-gateway/pkg/analytics.KuskGAApiSecret in Makefile

    README.md

    Add some status badges.

    Signed-off-by: Mohamed Bana [email protected]


    This PR...

    Changes

    Fixes

    Checklist

    • [ ] tested locally
    • [ ] added new dependencies
    • [ ] updated the docs
    • [ ] added a test
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)

Terraform Provider OpenAPI This terraform provider aims to minimise as much as possible the efforts needed from service providers to create and mainta

Dec 26, 2022
Kubernetes-native framework for test definition and execution

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ

Dec 31, 2022
Schematic - Generates model and validators by schema definition

schematic Generates model and validators by schema definition. Install Warning:

Feb 10, 2022
kubetnl tunnels TCP connections from within a Kubernetes cluster to a cluster-external endpoint, e.g. to your local machine. (the perfect complement to kubectl port-forward)

kubetnl kubetnl (kube tunnel) is a command line utility to tunnel TCP connections from within a Kubernetes to a cluster-external endpoint, e.g. to you

Dec 16, 2022
Lists some Kubernetes resources in cluster or at hosts.

k8s-native-app Containerized this: go build After building this we have binary files to dockerize. Create Dockerfile. docker build -t project-clientgo

Feb 12, 2022
A pod scaler golang app that can scale replicas either inside of cluster or out of the cluster

pod-scaler A simple pod scaler golang application that can scale replicas via manipulating the deployment Technologies The project has been created us

Oct 24, 2021
Go-gke-pulumi - A simple example that deploys a GKE cluster and an application to the cluster using pulumi

This example deploys a Google Cloud Platform (GCP) Google Kubernetes Engine (GKE) cluster and an application to it

Jan 25, 2022
Influxdb-cluster - InfluxDB Cluster for replacing InfluxDB Enterprise

InfluxDB ATTENTION: Around January 11th, 2019, master on this repository will be

Dec 26, 2022
A Terraform module to manage cluster authentication (aws-auth) for an Elastic Kubernetes (EKS) cluster on AWS.

Archive Notice The terraform-aws-modules/eks/aws v.18.20.0 release has brought back support aws-auth configmap! For this reason, I highly encourage us

Dec 4, 2022
Build a retractable ECS load balance network through aliyun openapi.

ECSEquilizer ้€š่ฟ‡้˜ฟ้‡Œไบ‘OpenAPIๅปบ็ซ‹ไธ€ไธชๅฏไผธ็ผฉ็š„่ดŸ่ฝฝๅ‡่กก็ฝ‘็ปœ่ฐƒๅบฆๅ™จใ€‚ ็ฎ€ไป‹ ไธบ็กฎไฟไปฃ็†้›†็พค็ฝ‘็ปœๅ’Œ่ฎก็ฎ—่ƒฝๅŠ›ๅฏไปฅ้€š่ฟ‡ECSไบ‘ๆœๅŠกๅŠจๆ€ไผธ็ผฉ๏ผŒๆ‰€ไปฅๅˆถๅฎšๅฎž็Žฐไปฅไธ‹็ญ–็•ฅใ€‚ ่Š‚็‚นๅˆ†ไธบstaticๅ’Œdynamicไธค็ง๏ผŒstatic่Š‚็‚นๆ˜ฏ้€š่ฟ‡้…็ฝฎๆ–‡ไปถ(config.yaml)ๅฎž็Žฐ้ข„่ฎพ็š„๏ผŒๅ›บๅฎšไธๅ˜ใ€‚ d

Jul 2, 2022
Open Source runtime tool which help to detect malware code execution and run time mis-configuration change on a kubernetes cluster
Open Source runtime tool which help to detect malware code execution and run time mis-configuration change on a kubernetes cluster

Kube-Knark Project Trace your kubernetes runtime !! Kube-Knark is an open source tracer uses pcap & ebpf technology to perform runtime tracing on a de

Sep 19, 2022
Open Source runtime scanner for OpenShift cluster and perform security audit checks based on CIS RedHat OpenShift Benchmark specification
Open Source runtime scanner for OpenShift cluster and perform security audit checks based on CIS RedHat OpenShift Benchmark specification

OpenShift-Ordeal Scan your Openshift cluster !! OpenShift-Ordeal is an open source audit scanner who perform audit check on OpenShift Cluster and outp

Sep 6, 2022
A Go script that makes your GitHub contribution activity panel look awesome! Display a message !
A Go script that makes your GitHub contribution activity panel look awesome! Display a message !

GitHub contributions generator A script written in Go, which goal is to make your GitHub contributions graph the way you want it to be. The goal of th

Jan 6, 2023
A cli that exposes your local resources to kubernetes
A cli that exposes your local resources to kubernetes

ktunnel Expose your local resources to kubernetes ?? Table of Contents About Getting Started Usage Documentation Contributing Authors Acknowledgments

Jan 7, 2023
A Terraform module that creates AWS alerts billing for your resources.

terraform-aws-billing-alarms terraform-aws-billing-alarms for project Replace name project to New Project agr 'terraform-aws-billing-alarms' 'new-pr

Oct 20, 2021
Krateo Platformops: Run your Resources on Every Cloud
Krateo Platformops: Run your Resources on Every Cloud

Krateo Platformops is an open source tool, based on CNCF projects such as Kubern

Dec 26, 2022
Kubedock is a minimal implementation of the docker api that will orchestrate containers on a Kubernetes cluster, rather than running containers locally.

Kubedock Kubedock is an minimal implementation of the docker api that will orchestrate containers on a kubernetes cluster, rather than running contain

Nov 11, 2022
K8s controller implementing Multi-Cluster Services API based on AWS Cloud Map.

AWS Cloud Map MCS Controller for K8s Introduction AWS Cloud Map multi-cluster service discovery for Kubernetes (K8s) is a controller that implements e

Dec 17, 2022
Kubernetes Cluster API Provider AWS
Kubernetes Cluster API Provider AWS

Kubernetes Cluster API Provider AWS Kubernetes-native declarative infrastructure for AWS. What is the Cluster API Provider AWS The Cluster API brings

Nov 2, 2022