Skip to content

Commit

Permalink
Merge branch 'pull_in_latest_upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Saleemi authored and yasn77 committed Jan 18, 2020
2 parents faca3cb + d00d733 commit 885a284
Show file tree
Hide file tree
Showing 60 changed files with 2,013 additions and 1,856 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project's packages adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v0.5.0]

## Changed

- Update the chart to latest [upstream version 1.0.0](https:/Kong/charts) (#043c2c2)

## Updated

- README contains some more information

## [v0.4.6]

## Added
Expand Down
136 changes: 134 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,141 @@

# kong-app chart

[Kong for Kubernetes](https:/Kong/kubernetes-ingress-controller) is
an open-source Ingress Controller for Kubernetes that offers API management capabilities
with a plugin architecture.

Giant Swarm offers a Kong Managed App which can be installed in tenant clusters.
Here we define the Kong chart with its templates and default configuration.

## Configuration
There are 3 ways that Kong can be configured in Kubernetes:

1. Using a Database (PostgreSQL or Cassandra)
1. Kong Kubernetes Ingress Controller (with CRDs)
1. DBless (no databases and static Configuration file)

The recommended and supported way is to use Ingress Controller (which works
alongside DBless).

This app does not by default provide a database and if a database is required,
then you will need to BYOD (Bring Your Own Database). For testing purposes, it
is possible launch postgres alongside this App (described below).

For detailed configuration options, please refer to the [configuration list](helm/kong-app/README.md#configuration)
also the [`values.yaml` file](helm/kong-app/values.yaml)

Any key value put under the `env` section translates to environment variables
used to control Kong's configuration. Every key is prefixed with KONG_ and
upper-cased before setting the environment variable.

### Kong Ingress Controller (Recommended)
The default installation of the App will use Kong Ingress Controller. This
method uses CRDs to configure various aspects of Kong. Please refer to Kong
Ingress Controller
[documentation](https:/Kong/kubernetes-ingress-controller/tree/master/docs)
for more detailed explanation and usage.

### DBLess Kong
The [official documentation](https://docs.konghq.com/1.4.x/db-less-and-declarative-config/)
explains how DBLess Kong works and the possible limitations. To use this method
of operation with this App, you will need to include the following you your
values YAML:

Using an existing ConfigMap
---------------------------
```YAML
env:
database: "off"
ingressController:
enabled: false
dblessConfig:
configMap: nameOfExistingConfigMap
```
Inline configuration
--------------------
```YAML
env:
database: "off"
ingressController:
enabled: false
dblessConfig:
config:
_format_version: "1.1"
services:
- name: example.com
url: http://example.com
routes:
- name: example
paths:
- "/example"
```
### Using your own Database
Kong supports two databases:
- PostgreSQL: 9.5 and above.
- Cassandra: 2.2 and above.
This section will focus on PostgreSQL, however the same process can be equally
applied to Cassandra.
Example database configuration:
```YAML
ingressController:
enabled: false
env:
database: "postgress" # can be "off" or "cassandra"
pg_host: 127.0.0.1
pg_user: postgres
pg_password: # This can also be a string value, but not recommended
valueFrom:
secretKeyRef:
key: kong
name: postgres
```
You can use any valid database configuration option inside `env`. This is also
how Cassandra can be configured.

#### Installing a database alongside the App
For testing purposes, it is possible to install a PostgreSQL server alongside
the App. To do this:

```YAML
postgresql:
enabled: true
postgresqlUsername: kong
postgresqlDatabase: kong
service:
port: 5432
```
(There is no need to add PostgreSQL configuration data to `env`)

Please note: This configuration should only really be used for testing and it
not something we can support

### Using Kong Ingress Controller with a Database
When using Kong Ingress Controller, their shouldn't be a need to use a Database.
However in some cases (for example, plugin support) a data store is
required. In these situations, it is possible to use a mixture of Kong Ingress
Controller and a database.

Like in the case of using a database, Giant Swarm do not support the database and
can only provide best efforts support with this configuration.

To configure, please see ['Using your own Database'](#using-your-own-database).
But ensure that that `ingressController.enabled` is set to `true`.

Note:
> Is it possible to create consumers using the Admin API?
>
> From version 0.5.0 onwards, Kong Ingress Controller tags each entity that it
> manages inside Kong's database and only manages the entities that it creates.
> This means that if consumers and credentials are created dynamically,
> they won't be deleted by the Ingress Controller.
(Taken from https:/Kong/kubernetes-ingress-controller/blob/master/docs/faq.md#is-it-possible-to-create-consumers-using-the-admin-api)


## Credit

* https:/helm/charts/tree/master/stable/kong
* https:/Kong/charts/
32 changes: 32 additions & 0 deletions helm/kong-app/FAQs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Frequently Asked Questions (FAQs)

#### Kong fails to start after `helm upgrade` when Postgres is used. What do I do?

You may be running into this issue: https:/helm/charts/issues/12575.
This issue is caused due to: https:/helm/helm/issues/3053.

The problem that happens is that Postgres database has the old password but
the new secret has a different password, which is used by Kong, and password
based authentication fails.

The solution to the problem is to specify a password to the `postgresql` chart.
This is to ensure that the password is not generated randomly but is set to
the same one that is user-provided on each upgrade.

#### Kong fails to start on a fresh installation with Postgres. What do I do?

Please make sure that there is no `PersistentVolumes` present from a previous
release. If there are, it can lead to data or passwords being out of sync
and result in connection issues.

A simple way to find out is to use the following command:

```
kubectl get pv -n <your-namespace>
```

And then based on the `AGE` column, determine if you have an old volume.
If you do, then please delete the release, delete the volume, and then
do a fresh installation. PersistentVolumes can remain in the cluster even if
you delete the namespace itself (the namespace in which they were present).

2 changes: 2 additions & 0 deletions helm/kong-app/OWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
approvers:
- hbagdi
- shashiranjan84
- rainest
reviewers:
- hbagdi
- shashiranjan84
- rainest
Loading

0 comments on commit 885a284

Please sign in to comment.