-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hybrid): Allow custom CommonName when
cluster_mtls: pki
(#804)
* feat(hybrid): Allow setting CommonName when using PKI for mTLS * docs(hybrid): Add Hybrid mode w/ Cert Manager example * Add changelog entry + bump chart version
- Loading branch information
Showing
9 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
This README explains how to install Kong in DB-backed mode with Postgres and Cert Manager | ||
|
||
# Install Postgres | ||
|
||
Use the bitnami chart to install Postgres. Read the output to understand how to connect to the database. | ||
|
||
```bash | ||
helm install postgres oci://registry-1.docker.io/bitnamicharts/postgresql -n db --create-namespace | ||
``` | ||
|
||
Once connected, create a postgres user and database: | ||
|
||
```sql | ||
CREATE USER kong WITH PASSWORD 'super_secret'; CREATE DATABASE kong OWNER kong; | ||
``` | ||
|
||
# Cert Manager | ||
|
||
Install Cert Manager in to your cluster: | ||
|
||
```bash | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.crds.yaml | ||
helm install \ | ||
cert-manager jetstack/cert-manager \ | ||
--namespace cert-manager \ | ||
--create-namespace \ | ||
--version v1.11.0 | ||
``` | ||
|
||
Create a self signed CA + Issuer for future use: | ||
|
||
```yaml | ||
echo " | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: kong | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: selfsigned-issuer | ||
spec: | ||
selfSigned: {} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: my-selfsigned-ca | ||
namespace: kong | ||
spec: | ||
isCA: true | ||
commonName: my-selfsigned-ca | ||
secretName: root-secret | ||
privateKey: | ||
algorithm: ECDSA | ||
size: 256 | ||
issuerRef: | ||
name: selfsigned-issuer | ||
kind: ClusterIssuer | ||
group: cert-manager.io | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: my-ca-issuer | ||
namespace: kong | ||
spec: | ||
ca: | ||
secretName: root-secret | ||
" | kubectl apply -f - | ||
``` | ||
# Kong | ||
Deploy Kong using the `cp-values.yaml` and `dp-values.yaml` in this folder: | ||
```bash | ||
helm install kong-cp kong/kong -n kong --values cp-values.yaml | ||
helm install kong-dp kong/kong -n kong --values dp-values.yaml | ||
``` | ||
You should now have Kong running in hybrid mode |
25 changes: 25 additions & 0 deletions
25
charts/kong/example-values/hybrid-cert-manager/cp-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
env: | ||
role: control_plane | ||
database: postgres | ||
pg_host: postgres-postgresql.db.svc.cluster.local | ||
pg_user: kong | ||
pg_password: super_secret | ||
|
||
cluster: | ||
enabled: true | ||
tls: | ||
enabled: true | ||
|
||
certificates: | ||
enabled: true | ||
issuer: my-ca-issuer | ||
cluster: | ||
enabled: true | ||
commonName: custom.example.com | ||
|
||
proxy: | ||
enabled: false | ||
|
||
ingressController: | ||
env: | ||
publish_service: kong/kong-cp-kong-proxy |
22 changes: 22 additions & 0 deletions
22
charts/kong/example-values/hybrid-cert-manager/dp-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
env: | ||
role: data_plane | ||
database: "off" | ||
cluster_control_plane: kong-cp-kong-cluster.kong.svc.cluster.local:8005 | ||
|
||
cluster: | ||
enabled: true | ||
tls: | ||
enabled: true | ||
|
||
certificates: | ||
enabled: true | ||
issuer: my-ca-issuer | ||
cluster: | ||
enabled: true | ||
commonName: custom.example.com | ||
|
||
admin: | ||
enabled: false | ||
|
||
ingressController: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters