Skip to content

Commit

Permalink
feat(kong): do not allow single-pod deployment with gw service discov…
Browse files Browse the repository at this point in the history
…ery (Kong#757)
  • Loading branch information
czeslavo authored Feb 21, 2023
1 parent 0565c9e commit 201eb8d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
This feature is only available when deploying chart with Kong Ingress Controller in version 2.9 or higher.
[#746](https://github.com/Kong/charts/pull/746)

### Under the hood
### Under the hood

* Add kube-linter to the CI pipeline to ensure produced manifests comply
with community best practices.
Expand Down
5 changes: 3 additions & 2 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,10 @@ For admin API service discovery:
The following admin API Service flags have to be provided in order for service
discovery to work:

- `ingressController.serviceDiscovery.adminApiServie.name`
- `ingressController.serviceDiscovery.adminApiServie.namespace`
- `ingressController.serviceDiscovery.adminApiService.name`
- `ingressController.serviceDiscovery.adminApiService.namespace`

Using this feature requires a split release installation of Gateways and Ingress Controller.
For exemplar `values.yaml` files which use this feature please see: [examples README.md](./example-values/README.md).

### General Parameters
Expand Down
7 changes: 6 additions & 1 deletion charts/kong/example-values/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ common Kong deployment scenarios on Kubernetes.
* [minimal-kong-sd-controller.yaml](minimal-kong-sd-controller.yaml) and
[minimal-kong-sd-gateway.yaml](minimal-kong-sd-gateway.yaml) install a
single controller and cluster of gateway instances. The controller release
configuration must specify the names of the gateway proxy and and admin
configuration must specify the names of the gateway proxy and admin
Services. The examples use `gw` as the gateway release name. If you wish to
use another name, set the controller configuration to match. For example, if
you use `hydrogen` as your gateway release name, set
`proxy.nameOverride=hydrogen-kong-proxy` and
`ingressController.adminApiService.name=hydrogen-kong-admin`.

* [minimal-kong-controller-konnect.yaml](minimal-kong-controller-konnect.yaml) installs Kong
open source with the ingress controller in DB-less mode, with Kong's Konnect sync feature
enabled. In order to make it work, `ingressController.konnect.runtimeGroupID` has to be
supplied.

All Enterprise examples require some level of additional user configuration to
install properly. Read the comments at the top of each file for instructions.
4 changes: 4 additions & 0 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ Return the admin API service name for service discovery
{{- fail (printf "Admin API service discovery is available in controller versions 2.9 and up. Detected %s" (include "kong.effectiveVersion" .Values.ingressController.image)) }}
{{- end }}

{{- if .Values.deployment.kong.enabled }}
{{- fail "deployment.kong.enabled and ingressController.serviceDiscovery.enabled are mutually exclusive and cannot be enabled at once. Admin API service discovery requires a split release installation of Gateways and Ingress Controller." }}
{{- end }}

{{- $namespace := $adminApiService.namespace | default ( include "kong.namespace" . ) -}}
{{- $name := $adminApiService.name -}}
{{- $_ := required ".ingressController.serviceDiscovery.adminApiService.name has to be provided when .Values.ingressController.serviceDiscovery.enabled is set to true" $name -}}
Expand Down

0 comments on commit 201eb8d

Please sign in to comment.