Skip to content
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
8 changes: 7 additions & 1 deletion apis/installer/v1alpha1/ace_acaas_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type AcaasSpec struct {

Global AcaasGlobalValues `json:"global"`
Ingress AcaasIngress `json:"ingress"`
Gateway AceGateway `json:"gateway"`
Gateway AcaasGateway `json:"gateway"`
}

type AceBilling struct {
Expand Down Expand Up @@ -137,6 +137,12 @@ type AcaasIngressTLS struct {
Secret LocalObjectReference `json:"secret"`
}

type AcaasGateway struct {
Enabled bool `json:"enabled"`
*GatewaySpec `json:",inline,omitempty"`
Rules AcaasIngressRules `json:"rules"`
}

type AcaasIngressRules struct {
Blog ExternalService `json:"blog"`
Docs ExternalService `json:"docs"`
Expand Down
21 changes: 21 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions charts/acaas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ The following table lists the configurable parameters of the `acaas` chart and t
| gateway.enabled | | <code>false</code> |
| gateway.tls.enabled | | <code>true</code> |
| gateway.tls.secret.name | | <code>"ace-cert"</code> |
| gateway.rules.blog.upstream | | <code>""</code> |
| gateway.rules.docs.upstream | | <code>""</code> |
| gateway.rules.learn.upstream | | <code>""</code> |
| gateway.rules.license.upstream | | <code>""</code> |
| gateway.rules.selfhost.upstream | | <code>""</code> |
| ingress.enabled | | <code>true</code> |
| ingress.className | | <code>"nginx-ace"</code> |
| ingress.tls.enable | | <code>true</code> |
Expand Down
9 changes: 6 additions & 3 deletions charts/acaas/templates/blog/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ spec:
type: PathPrefix
value: /blog
backendRefs:
- group: ""
kind: Service
- group: gateway.envoyproxy.io
kind: Backend
name: blog
namespace: {{ .Release.Namespace }}
port: 443
weight: 1
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ .Values.gateway.rules.blog.upstream }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/acaas/templates/blog/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq (toString .Values.global.platform.deploymentType) "Hosted" }}
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "ingress" "enabled") }}
apiVersion: v1
kind: Service
metadata:
Expand Down
9 changes: 7 additions & 2 deletions charts/acaas/templates/docs/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ spec:
type: PathPrefix
value: /docs
backendRefs:
- kind: Service
- group: gateway.envoyproxy.io
kind: Backend
name: docs
namespace: {{ .Release.Namespace }}
port: 443
weight: 1
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ .Values.gateway.rules.docs.upstream }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/acaas/templates/docs/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq (toString .Values.global.platform.deploymentType) "Hosted" }}
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "ingress" "enabled") }}
apiVersion: v1
kind: Service
metadata:
Expand Down
44 changes: 44 additions & 0 deletions charts/acaas/templates/gateway-backends.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "gateway" "enabled") }}
{{- range $name, $rule := .Values.gateway.rules }}
---
# Backend: resolves the external upstream by FQDN so Envoy uses a STRICT_DNS
# cluster instead of Kubernetes EndpointSlices. An ExternalName Service has no
# EndpointSlices, so plain backendRefs -> Service report zero ready endpoints.
# Requires extensionApis.enableBackend: true in the EnvoyGateway config.
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
{{- with $.Values.gateway.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ $name }}
namespace: {{ $.Release.Namespace }}
spec:
endpoints:
- fqdn:
hostname: {{ $rule.upstream }}
port: 443
---
# BackendTLSPolicy: makes Envoy originate TLS to the Backend above. Without it
# Envoy connects in plaintext on 443 and the upstream (which terminates TLS on
# that port) resets the connection with a protocol_error.
apiVersion: gateway.networking.k8s.io/v1alpha3
kind: BackendTLSPolicy
metadata:
{{- with $.Values.gateway.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ $name }}
namespace: {{ $.Release.Namespace }}
spec:
targetRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: {{ $name }}
validation:
hostname: {{ $rule.upstream }}
wellKnownCACertificates: System
{{- end }}
{{- end }}
9 changes: 7 additions & 2 deletions charts/acaas/templates/learn/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ spec:
type: PathPrefix
value: /learn
backendRefs:
- kind: Service
- group: gateway.envoyproxy.io
kind: Backend
name: learn
namespace: {{ .Release.Namespace }}
port: 443
weight: 1
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ .Values.gateway.rules.learn.upstream }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/acaas/templates/learn/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq (toString .Values.global.platform.deploymentType) "Hosted" }}
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "ingress" "enabled") }}
apiVersion: v1
kind: Service
metadata:
Expand Down
9 changes: 7 additions & 2 deletions charts/acaas/templates/license/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ spec:
type: PathPrefix
value: /issue-license
backendRefs:
- kind: Service
- group: gateway.envoyproxy.io
kind: Backend
name: license
namespace: {{ .Release.Namespace }}
port: 443
weight: 1
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ .Values.gateway.rules.license.upstream }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/acaas/templates/license/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq (toString .Values.global.platform.deploymentType) "Hosted" }}
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "ingress" "enabled") }}
apiVersion: v1
kind: Service
metadata:
Expand Down
9 changes: 7 additions & 2 deletions charts/acaas/templates/selfhost/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ spec:
type: PathPrefix
value: /selfhost
backendRefs:
- kind: Service
- group: gateway.envoyproxy.io
kind: Backend
name: selfhost
namespace: {{ .Release.Namespace }}
port: 443
weight: 1
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ .Values.gateway.rules.selfhost.upstream }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/acaas/templates/selfhost/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq (toString .Values.global.platform.deploymentType) "Hosted" }}
{{- if and (eq (toString .Values.global.platform.deploymentType) "Hosted") (index .Values "ingress" "enabled") }}
apiVersion: v1
kind: Service
metadata:
Expand Down
13 changes: 13 additions & 0 deletions charts/acaas/values.ninja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ global:
host: appscode.ninja
deploymentType: Hosted

gateway:
rules:
blog:
upstream: blog-prod.web.app
docs:
upstream: bb-docs-qa.web.app
learn:
upstream: learn-qa.web.app
license:
upstream: x.appscode.com
selfhost:
upstream: selfhosting-qa.web.app

ingress:
rules:
blog:
Expand Down
13 changes: 13 additions & 0 deletions charts/acaas/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ global:
host: appscode.com
deploymentType: Hosted

gateway:
rules:
blog:
upstream: blog-prod.web.app
docs:
upstream: byte-builders-docs.web.app
learn:
upstream: byte-builders-learn.web.app
license:
upstream: x.appscode.com
selfhost:
upstream: byte-builders-selfhosting.web.app

ingress:
rules:
blog:
Expand Down
11 changes: 11 additions & 0 deletions charts/acaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ gateway:
enabled: true
secret:
name: "ace-cert"
rules:
blog:
upstream: ""
docs:
upstream: ""
learn:
upstream: ""
license:
upstream: ""
selfhost:
upstream: ""

ingress:
enabled: true
Expand Down
Loading