Skip to content

Commit 6df3892

Browse files
author
Ronen Hilewicz
authored
Merge pull request #41 from aserto-dev/ingress
Support native Kubernetes Ingress
2 parents d966d2f + 150de36 commit 6df3892

72 files changed

Lines changed: 829 additions & 684 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,21 @@ jobs:
8989
name: Create k8s cluster
9090
with:
9191
cluster-name: "test"
92-
args: >
92+
args: >-
93+
-p "9009:80@loadbalancer"
9394
--agents 1
9495
--k3s-arg "--disable=metrics-server@server:*"
96+
-
97+
name: Configure DNS
98+
run: |
99+
sudo tee -a /etc/hosts >/dev/null <<EOF
100+
# Local self-host cluster
101+
127.0.0.1 controller.local.test
102+
127.0.0.1 grpc-controller.local.test
103+
127.0.0.1 directory.local.test
104+
127.0.0.1 grpc-directory.local.test
105+
127.0.0.1 discovery.local.test
106+
EOF
95107
-
96108
name: Test Topaz
97109
timeout-minutes: 10
@@ -110,14 +122,15 @@ jobs:
110122
name: Deploy Postgres
111123
run: |
112124
helm install postgresql oci://registry-1.docker.io/bitnamicharts/postgresql \
113-
--namespace postgres --create-namespace \
125+
--namespace postgresql --create-namespace \
126+
--set fullnameOverride=postgres \
114127
--set auth.postgresPassword=${{ env.POSTGRES_PASSWORD }}
115128
-
116129
name: Wait for Postgres
117130
run: |
118131
echo "Waiting for postgres to be ready"
119132
kubectl wait pods --selector app.kubernetes.io/name=postgresql \
120-
--for condition=Ready --namespace postgres --timeout=60s
133+
--for condition=Ready --namespace postgresql --timeout=60s
121134
-
122135
name: Generate admin ssh key
123136
id: sshkey

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ global:
162162
aserto:
163163
ports:
164164
grpc: 8282
165-
https: 8383
165+
http: 8383
166166
health: 8484
167167
mertics: 8585
168168
...
@@ -201,7 +201,7 @@ values for several required fields:
201201

202202
- `global.aserto.oidc` holds the domain and client ID for your OpenID Connect application used
203203
to authenticate access to the management console.
204-
- `global.aserto.https.allowed_origins` should include the ingress domain where the management console
204+
- `global.aserto.http.allowed_origins` should include the ingress domain where the management console
205205
will be hosted.
206206
- `diretcory.rootDirectory.database.host` and `directory.tenantDirectory.database.host` should be set
207207
to the hostname of the PostgreSQL instance(s) for the root and tenant directories.

charts/aserto-lib/templates/_clusteraddr.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Args: [scope, config, service]
1818
{{- else }}
1919
{{- $port := include "aserto-lib.ports" (list $scope $cfg) | fromYaml | dig $portType "" | toYaml }}
2020
{{- if contains $svc $scope.Release.Name }}
21-
{{- printf "%s.%s.svc.cluster.local:%s" $scope.Release.Name $scope.Release.Namespace $port }}
21+
{{- printf "%s-%s.%s.svc.cluster.local:%s" $scope.Release.Name $portType $scope.Release.Namespace $port }}
2222
{{- else }}
23-
{{- printf "%s-%s.%s.svc.cluster.local:%s" $scope.Release.Name $svc $scope.Release.Namespace $port }}
23+
{{- printf "%s-%s-%s.%s.svc.cluster.local:%s" $scope.Release.Name $svc $portType $scope.Release.Namespace $port }}
2424
{{- end }}
2525
{{- end }}
2626
{{- end }}
@@ -43,6 +43,6 @@ Cluster address of the directory service
4343
Cluster address of the discovery service
4444
*/}}
4545
{{- define "aserto-lib.discoveryAddress" }}
46-
{{- include "aserto-lib.svcClusterAddress" (list . "https" "discovery" )}}
46+
{{- include "aserto-lib.svcClusterAddress" (list . "http" "discovery" )}}
4747
{{- end }}
4848

charts/aserto-lib/templates/_golangsvc.tpl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Returns gRPC service options.
66
{{- end }}
77

88
{{/*
9-
Returns HTTPS service options.
9+
Returns HTTP service options.
1010
*/}}
11-
{{- define "aserto-lib.httpsConfig" }}
12-
{{ include "aserto-lib.mergeGlobal" (list . "https") }}
11+
{{- define "aserto-lib.httpConfig" }}
12+
{{ include "aserto-lib.mergeGlobal" (list . "http") }}
1313
{{- end }}
1414

1515
{{/*
@@ -29,11 +29,11 @@ certs:
2929
{{- end }}
3030

3131
{{/*
32-
Renders HTTPS service configuration.
32+
Renders HTTP service configuration.
3333
*/}}
34-
{{- define "aserto-lib.httpsService" -}}
35-
listen_address: 0.0.0.0:{{ include "aserto-lib.httpsPort" . }}
36-
{{- with include "aserto-lib.httpsConfig" . | fromYaml }}
34+
{{- define "aserto-lib.httpService" -}}
35+
listen_address: 0.0.0.0:{{ include "aserto-lib.httpPort" . }}
36+
{{- with include "aserto-lib.httpConfig" . | fromYaml }}
3737
{{- with .allowed_origins }}
3838
allowed_origins:
3939
{{- . | toYaml | nindent 2 }}
@@ -44,9 +44,9 @@ write_timeout: {{ .write_timeout | default "2s" }}
4444
idle_timeout: {{ .idle_timeout | default "30s" }}
4545
{{- with .certSecret }}
4646
certs:
47-
tls_key_path: '/https-certs/tls.key'
48-
tls_cert_path: '/https-certs/tls.crt'
49-
tls_ca_cert_path: '/https-certs/ca.crt'
47+
tls_key_path: '/tls-certs/tls.key'
48+
tls_cert_path: '/tls-certs/tls.crt'
49+
tls_ca_cert_path: '/tls-certs/ca.crt'
5050
{{- end }}
5151
{{- end }}
5252
{{- end }}

charts/aserto-lib/templates/_ports.tpl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Returns port configuration.
33
Values are selected with the following precedence:
44
1. .Values.ports (chart specific overrides)
55
2. .Values.global.aserto.ports (global overrides)
6-
3. default values ({grpc: 8282, https: 8383, health: 8484, metrics: 8585})
6+
3. default values ({grpc: 8282, http: 8383, health: 8484, metrics: 8585})
77
*/}}
88
{{- define "aserto-lib.ports" }}
99
{{- $scope := first . }}
1010
{{- $svc := last . }}
11-
{{- $defaults := dict "grpc" 8282 "https" 8383 "health" 8484 "metrics" 8585}}
11+
{{- $defaults := dict "grpc" 8282 "http" 8383 "health" 8484 "metrics" 8585}}
1212
{{- $global := ($scope.global).aserto | default dict | dig "ports" dict }}
1313
{{- $local := $svc | eq "self" | ternary $scope.ports (dig "global" "aserto" $svc "ports" dict $scope.AsMap) }}
1414
{{- merge $local $global $defaults | toYaml }}
@@ -22,8 +22,8 @@ Values are selected with the following precedence:
2222
{{- (include "aserto-lib.ports" (list . "self") | fromYaml).grpc }}
2323
{{- end }}
2424

25-
{{- define "aserto-lib.httpsPort" }}
26-
{{- (include "aserto-lib.ports" (list . "self") | fromYaml).https }}
25+
{{- define "aserto-lib.httpPort" }}
26+
{{- (include "aserto-lib.ports" (list . "self") | fromYaml).http }}
2727
{{- end }}
2828

2929
{{- define "aserto-lib.healthPort" }}
@@ -34,3 +34,17 @@ Values are selected with the following precedence:
3434
{{- (include "aserto-lib.ports" (list . "self") | fromYaml).metrics }}
3535
{{- end }}
3636

37+
{{- define "aserto-lib.ingressDomain" -}}
38+
{{ (.Values.ingress).domain | default (((.Values.global).aserto).ingress).domain }}
39+
{{- end }}
40+
41+
{{- define "aserto-lib.ingressHost" -}}
42+
{{- $scope := first . -}}
43+
{{- $svc := last . -}}
44+
{{- $domain := include "aserto-lib.ingressDomain" $scope -}}
45+
{{- if $domain -}}
46+
{{ printf "%s.%s" $svc.subdomain $domain | quote }}
47+
{{- else -}}
48+
{{ $svc.host | quote | required "ingress.hosts[].host is required if ingress.domain is empty" }}
49+
{{- end -}}
50+
{{- end }}

charts/aserto/values.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ global:
1414
# Port configuration.
1515
ports:
1616
grpc: 8282
17-
https: 8383
17+
http: 8383
1818
health: 8484
1919
mertics: 8585
2020

2121
# gRPC configuration.
2222
grpc:
2323
connectionTimeoutSec: 2
2424

25-
# HTTPS configuration.
26-
https:
25+
# HTTP configuration.
26+
http:
2727
read_timeout: 2s
2828
read_header_timeout: 2s
2929
write_timeout: 2s
@@ -218,5 +218,8 @@ scim:
218218
# groupMappings: []
219219
# userMappings: []
220220

221+
multi-tenant-scim:
222+
enabled: false
223+
221224
registry-proxy:
222225
enabled: false

charts/authorizer/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ version: 0.1.10
2727
# incremented each time you make changes to the application. Versions are not expected to
2828
# follow Semantic Versioning. They should reflect the version the application is using.
2929
# It is recommended to use it with quotes.
30-
appVersion: 0.15.8
30+
appVersion: 0.16.0
3131

3232
dependencies:
3333
- name: aserto-lib

charts/authorizer/ci/test-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
oidc:
33
domain: oidc_domain
44
audience: oidc_audience
5+
6+
ingress:
7+
enabled: true
8+
domain: aserto.com

charts/authorizer/templates/_helpers.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ credentials:
8080
{{- with (include "aserto-lib.discoveryCfg" . | fromYaml) }}
8181
{{- if .disableTLSVerification }}
8282
allow_insecure_tls : true
83-
{{- else if .httpsCertSecret }}
83+
{{- else if .tlsCertSecret }}
8484
tls:
85-
ca_cert: /discovery-https-certs/ca.crt
85+
ca_cert: /discovery-tls-certs/ca.crt
8686
{{- else }}
8787
tls:
88-
ca_cert: /https-certs/ca.crt
88+
ca_cert: /tls-certs/ca.crt
8989
{{- end }}
9090
{{- end }}
9191
{{- end }}
9292

9393
{{- define "authorizer.gatewayService" -}}
94-
{{ include "aserto-lib.httpsService" . }}
95-
{{- $cfg := include "aserto-lib.httpsConfig" . | fromYaml }}
94+
{{ include "aserto-lib.httpService" . }}
95+
{{- $cfg := include "aserto-lib.httpConfig" . | fromYaml }}
9696
allowed_headers:
9797
{{- $cfg.allowed_headers | default (list "Aserto-Tenant-Id" "Authorization" "Content-Type" "Depth") | toYaml | nindent 2 }}
9898
{{- end }}

charts/authorizer/templates/config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ stringData:
4242
authenticators_enabled:
4343
root_key: true
4444
oidc: true
45-
anonymous: true
4645
{{- if (.Values.authentication).machineAccounts }}
4746
machine_account: true
4847
{{- end }}
@@ -55,6 +54,13 @@ stringData:
5554
- key: ${AUTHORIZER_ROOT_KEY}
5655
account: root-key-authorizer@aserto.com
5756
57+
override:
58+
- methods:
59+
- /grpc.reflection.v1.ServerReflection/ServerReflectionInfo
60+
- /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo
61+
authenticators_enabled:
62+
anonymous: true
63+
5864
opa:
5965
instance_id: "-"
6066
graceful_shutdown_period_seconds: 2

0 commit comments

Comments
 (0)