Skip to content

Commit

Permalink
rename all external references to nginx-ingress to ingress-nginx (#181)
Browse files Browse the repository at this point in the history
* rename all external references to nginx-ingress to ingress-nginx
* add note that the ingress nginx generator refers to the community edition from Kubernetes
  • Loading branch information
Kyle Hodgetts committed Oct 7, 2021
1 parent 2cd2a02 commit a782e0f
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 33 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Kusk currently supports (click for configuration options)
- [Ambassador 2.0](https://kubeshop.github.io/kusk/ambassador2/)
- **Warning** This is a developer preview and should be treated as unstable
- [Linkerd](https://kubeshop.github.io/kusk/linkerd/)
- [Nginx-Ingress](https://kubeshop.github.io/kusk/nginx-ingress/)
- [Ingress-Nginx](https://kubeshop.github.io/kusk/ingress-nginx/)
- This generator refers to the community ingress from [Kubernetes ingress-nginx](https://github.com/kubernetes/ingress-nginx/)
- [Traefik V2 (v2.x)](https://kubeshop.github.io/kusk/traefik/)

Some of the upcoming tools we'd like to support are Kong and Contour. Please don't hesitate to
Expand Down
2 changes: 1 addition & 1 deletion cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (c *Client) DetectNginxIngress() (bool, error) {
}

if !errors.IsNotFound(err) {
return false, fmt.Errorf("error fetching nginx-ingress deployments: %w", err)
return false, fmt.Errorf("error fetching ingress-nginx deployments: %w", err)
}

return false, nil
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Available Commands:
completion generate the autocompletion script for the specified shell
help Help about any command
linkerd Generates Linkerd Service Profiles for your service
nginx-ingress Generates nginx-ingress resources
ingress-nginx Generates ingress-nginx resources
traefik Generates Traefik resources
wizard Connects to current Kubernetes cluster and lists available generators

Expand Down
26 changes: 14 additions & 12 deletions docs/nginx-ingress.md → docs/ingress-nginx.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Nginx Ingress

**Note** This generator refers to the community ingress from [Kubernetes ingress-nginx](https://github.com/kubernetes/ingress-nginx/)

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

Usage:
kusk nginx-ingress [flags]
kusk ingress-nginx [flags]

Flags:
-i, --in string file path to api spec file to generate mappings from. e.g. --in apispec.yaml
Expand All @@ -17,10 +19,10 @@ Flags:
--nginx_ingress.rewrite_target string a custom NGINX rewrite target
--path.base string a base path for Service endpoints (default "/")
--path.trim_prefix string a prefix to trim from the URL before forwarding to the upstream Service
-h, --help help for nginx-ingress
-h, --help help for ingress-nginx
```

The nginx-ingress generator generates [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource)
The ingress-nginx generator generates [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource)
resources for exposing HTTP and HTTPS routes from outside the cluster to services within the cluster.

All options that can be set via flags can also be set using our `x-kusk` OpenAPI extension in your specification.
Expand Down Expand Up @@ -55,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 nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -108,7 +110,7 @@ provided OpenAPI specification

### CLI Flags
```shell
kusk nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name booksapp \
--service.port 7000 \
Expand Down Expand Up @@ -191,7 +193,7 @@ request onto the service.

### CLI Flags
```shell
kusk nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -249,7 +251,7 @@ status:
## Setting the rewrite target
### CLI Flags
```shell
kusk nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -304,7 +306,7 @@ status:
## Setting the Host
### CLI Flags
```shell
kusk nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -357,13 +359,13 @@ status:
## Setting timeouts
kusk allows for setting a request timeout via flags or the x-kusk OpenAPI extension

The nginx-ingress generator will spread the total request time over the following settings, diving it by 2
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 nginx-ingress -i examples/booksapp/booksapp.yaml \
kusk ingress-nginx -i examples/booksapp/booksapp.yaml \
--namespace my-namespace \
--service.name webapp \
--service.port 7000 \
Expand Down Expand Up @@ -420,7 +422,7 @@ status:
## CORS
Via the x-kusk extension, you can set cors policies on your resources.

Due to a limitation of the nginx-ingress controller, we can only choose a single origin (the first one)
Due to a limitation of the ingress-nginx controller, we can only choose a single origin (the first one)
from `cors.origins`. Kusk logs a warning informing you of this.

### OpenAPI Specification
Expand Down
8 changes: 4 additions & 4 deletions docs/openapi-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ within the `x-kusk` extension. The extension can be specified at the root, path

The following top-level properties are available:

| property | root | path | operation | [Amb 1.X](ambassador.md) | [Amb 2.X](ambassador2.md) | [LinkerD](linkerd.md) | [Nginx-Ing](nginx-ingress.md) | [Traefik](traefik.md)
| property | root | path | operation | [Amb 1.X](ambassador.md) | [Amb 2.X](ambassador2.md) | [LinkerD](linkerd.md) | [Ing-Nginx](ingress-nginx.md) | [Traefik](traefik.md)
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [`disabled`](#disabled) | X | X | X | X | X | X | X | X
| [`host`](#host) | X | X | X | X | X | X | X | X
Expand All @@ -20,7 +20,7 @@ The following top-level properties are available:
| [`path`](#path) | X | | | X | X | X | X | X
| [`cluster`](#cluster) | X | | | | | X | |
| [`host`](#host) | X | | | | X | | X | X
| [`nginx_ingress`](#nginx-ingress) | X | | | | | | X |
| [`nginx_ingress`](#ingress-nginx) | X | | | | | | X |

### Property Overriding/inheritance

Expand Down Expand Up @@ -124,9 +124,9 @@ Please see the documentation for each individual generator to see which of these
A string specifying an Ingress host rule - see
https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules for additional documentation.

### Nginx Ingress
### Ingress Nginx

Options specific to the [Nginx-Ingress controller](nginx-ingress.md)
Options specific to the [ingress-nginx controller](ingress-nginx.md)

| Name | Description |
| :---: | :--- |
Expand Down
2 changes: 1 addition & 1 deletion examples/petstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EOF
kubectl patch deployment ingress-nginx-controller -n ingress-nginx --patch "$(cat ingress.yaml)"

# Generate the ingress resource from the specification
go run main.go nginx-ingress -i examples/petstore/petstore.yaml --path.base="/" --service.name "petstore" | kubectl apply -f -
go run main.go ingress-nginx -i examples/petstore/petstore.yaml --path.base="/" --service.name "petstore" | kubectl apply -f -

# cURL an api endpoint
curl -kLi 'http://localhost:8080/api/v3/pet/findByStatus?status=available'
Expand Down
2 changes: 1 addition & 1 deletion generators/nginx_ingress/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (g *Generator) generateAnnotations(

if burst := rateLimits.Burst; burst != 0 {
// https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rate-limiting
// nginx-ingress uses a burst multiplier to configure burst for a rate limited path,
// ingress-nginx uses a burst multiplier to configure burst for a rate limited path,
// i.e. burst = rps * burstMultiplier
var burstMultiplier = burst / rps
if burstMultiplier < 1 {
Expand Down
12 changes: 6 additions & 6 deletions generators/nginx_ingress/nginx_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ var (
)

func init() {
generators.Registry["nginx-ingress"] = &Generator{}
generators.Registry["ingress-nginx"] = &Generator{}
}

type Generator struct{}

func (g *Generator) Cmd() string {
return "nginx-ingress"
return "ingress-nginx"
}

func (g *Generator) Flags() *pflag.FlagSet {
fs := pflag.NewFlagSet("nginx-ingress", pflag.ExitOnError)
fs := pflag.NewFlagSet("ingress-nginx", pflag.ExitOnError)

fs.String(
"path.base",
Expand Down Expand Up @@ -97,7 +97,7 @@ func (g *Generator) Flags() *pflag.FlagSet {
}

func (g *Generator) ShortDescription() string {
return "Generates nginx-ingress resources"
return "Generates ingress-nginx resources"
}

func (g *Generator) LongDescription() string {
Expand Down Expand Up @@ -292,7 +292,7 @@ func (g *Generator) shouldSplit(opts *options.Options, spec *openapi3.T) bool {

if ro.Group != "" {
log.New(os.Stderr, "WARN", log.Lmsgprefix).
Printf("nginx-ingress does not support rate limit groups. These will be ignored")
Printf("ingress-nginx does not support rate limit groups. These will be ignored")

groupUnsupportedWarned = true
}
Expand Down Expand Up @@ -339,7 +339,7 @@ func (g *Generator) shouldSplit(opts *options.Options, spec *openapi3.T) bool {
for method := range pathItem.Operations() {
if _, ok := opts.OperationSubOptions[method+path]; ok {
log.New(os.Stderr, "WARN", log.Lmsgprefix).
Printf("HTTP Method level options detected which nginx-ingress doesn't support. These will be ignored")
Printf("HTTP Method level options detected which ingress-nginx doesn't support. These will be ignored")

break // Only need to warn users once
}
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nav:
- Ambassador 1.X: ambassador.md
- Ambassador 2.X: ambassador2.md
- Linkerd: linkerd.md
- Nginx-Ingress: nginx-ingress.md
- Ingress-Nginx: ingress-nginx.md
- Traefik: traefik.md

- For Developers: development.md
Expand Down
2 changes: 1 addition & 1 deletion wizard/flow/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func New(args *Args) (Interface, error) {
}, nil
case "linkerd":
return linkerdFlow{baseFlow}, nil
case "nginx-ingress":
case "ingress-nginx":
return nginxIngressFlow{baseFlow}, nil
case "traefik":
return traefikFlow{baseFlow}, nil
Expand Down
9 changes: 5 additions & 4 deletions wizard/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"path/filepath"

"github.com/getkin/kin-openapi/openapi3"
"k8s.io/client-go/util/homedir"

"github.com/kubeshop/kusk/cluster"
"github.com/kubeshop/kusk/spec"
"github.com/kubeshop/kusk/wizard/flow"
"github.com/kubeshop/kusk/wizard/prompt"
"k8s.io/client-go/util/homedir"
)

func Start(apiSpecPath string, apiSpec *openapi3.T, prompt prompt.Prompter) {
Expand Down Expand Up @@ -107,8 +108,8 @@ func flowWithCluster(args *flow.Args, kubeConfigPath string) (string, error) {
}

if nginxIngressFound {
servicesToSuggest = append(servicesToSuggest, "nginx-ingress")
fmt.Fprintln(os.Stderr, "✔ Nginx Ingress installation found")
servicesToSuggest = append(servicesToSuggest, "ingress-nginx")
fmt.Fprintln(os.Stderr, "✔ Ingress Nginx installation found")
}

if traefikFound {
Expand Down Expand Up @@ -153,7 +154,7 @@ func flowWithoutCluster(args *flow.Args) (string, error) {
[]string{
"ambassador",
"linkerd",
"nginx-ingress",
"ingress-nginx",
"traefik",
},
false,
Expand Down

0 comments on commit a782e0f

Please sign in to comment.