Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dedicated Portal auth configuration from values.yaml #55

Merged
merged 2 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,13 @@ accessible outside the Pod.

Login sessions for Kong Manager and the Developer Portal make use of
[the Kong Sessions plugin](https://docs.konghq.com/enterprise/latest/kong-manager/authentication/sessions).
Their configuration must be stored in Secrets, as it contains an HMAC key.
If using either RBAC or the Portal, create a Secret with `admin_gui_session_conf`
and `portal_session_conf` keys.
When configured via values.yaml, their configuration must be stored in Secrets,
as it contains an HMAC key.

Kong Manager's session configuration must be configured via values.yaml,
whereas this is optional for the Developer Portal on versions 0.36+. Providing
Portal session configuration in values.yaml provides the default session
configuration, which can be overriden on a per-workspace basis.

```
$ cat admin_gui_session_conf
Expand All @@ -467,9 +471,9 @@ secret/kong-session-config created
The exact plugin settings may vary in your environment. The `secret` should
always be changed for both configurations.

After creating your secret, set its name in values.yaml, in the
`.enterprise.rbac.session_conf_secret` and
`.enterprise.portal.session_conf_secret` keys.
After creating your secret, set its name in values.yaml in
`.enterprise.rbac.session_conf_secret`. If you create a Portal configuration,
add it at `env.portal_session_conf` using a secretKeyRef.

### Email/SMTP

Expand Down
19 changes: 12 additions & 7 deletions charts/kong/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
To connect to Kong, please execute the following command
To connect to Kong, please execute the following commands:


{{- if contains "LoadBalancer" .Values.proxy.type }}
HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].port}')
{{ if contains "LoadBalancer" .Values.proxy.type }}
HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].port}')
{{- else if contains "NodePort" .Values.proxy.type -}}
HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath='{.items[0].status.addresses[0].address}')
PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].nodePort}')
HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath='{.items[0].status.addresses[0].address}')
PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "kong.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].nodePort}')
{{- end -}}
export PROXY_IP=${HOST}:${PORT}
curl $PROXY_IP

Once installed, please follow along the getting started guide to start using Kong:
https://bit.ly/k4k8s-get-started

{{ if and (.Values.enterprise.portal.enabled) (or (.Values.enterprise.portal.portal_auth) (.Values.enterprise.portal.session_conf_secret)) -}} {{/* Legacy Portal auth handling */}}
/!\ WARNING: You are currently using legacy Portal authentication configuration in values.yaml (https://github.com/Kong/charts/blob/kong-1.2.0/charts/kong/values.yaml#L384-L392). Support for this will be removed in a future release.
rainest marked this conversation as resolved.
Show resolved Hide resolved

You should move these settings to "portal_session_conf" (using a secretKeyRef) and "portal_auth" under your "env" block.
{{- end -}}

2 changes: 1 addition & 1 deletion charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ the template that it itself is using form the above sections.

{{- if .Values.enterprise.portal.enabled }}
{{- $_ := set $autoEnv "KONG_PORTAL" "on" -}}
{{- if .Values.enterprise.portal.portal_auth }}
{{- if .Values.enterprise.portal.portal_auth }} {{/* TODO: deprecated, remove in a future version */}}
{{- $_ := set $autoEnv "KONG_PORTAL_AUTH" .Values.enterprise.portal.portal_auth -}}
{{- $portalSession := include "secretkeyref" (dict "name" .Values.enterprise.portal.session_conf_secret "key" "portal_session_conf") -}}
{{- $_ := set $autoEnv "KONG_PORTAL_SESSION_CONF" $portalSession -}}
Expand Down
11 changes: 0 additions & 11 deletions charts/kong/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,10 @@ enterprise:
# This secret must contain a single 'license' key, containing your base64-encoded license data
# The license secret is required for all Kong Enterprise deployments
license_secret: you-must-create-a-kong-license-secret
# Session configuration secret
# The session conf secret is required if using RBAC or the Portal
vitals:
enabled: true
portal:
enabled: false
# portal_auth here sets the default authentication mechanism for the Portal
# FIXME This can be changed per-workspace, but must currently default to
# basic-auth to work around limitations with session configuration
portal_auth: basic-auth
# If the Portal is enabled and any workspace's Portal uses authentication,
# this Secret must contain an portal_session_conf key
# The key value must be a secret configuration, following the example at
# https://docs.konghq.com/enterprise/latest/developer-portal/configuration/authentication/sessions
session_conf_secret: you-must-create-a-portal-session-conf-secret
rbac:
enabled: false
admin_gui_auth: basic-auth
Expand Down