Skip to content

Commit

Permalink
Fix db ui charts (#926)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Mar 14, 2024
1 parent 4980570 commit f8ea950
Show file tree
Hide file tree
Showing 20 changed files with 154 additions and 86 deletions.
6 changes: 5 additions & 1 deletion charts/dbgate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ The following table lists the configurable parameters of the `dbgate` chart and
| affinity | | <code>{}</code> |
| namespace.create | | <code>false</code> |
| gateway.className | | <code>"ace"</code> |
| gateway.port | | <code>8080</code> |
| gateway.port | | <code>8082</code> |
| gateway.tlsSecretRef.name | | <code>service-presets-cert</code> |
| gateway.tlsSecretRef.namespace | | <code>ace</code> |
| gateway.referenceGrant.create | | <code>true</code> |
| keda.proxyService.namespace | | <code>"keda"</code> |
| keda.proxyService.name | | <code>"keda-add-ons-http-interceptor-proxy"</code> |
| keda.proxyService.port | | <code>8080</code> |
| targetPendingRequests | | <code>200</code> |
| autoscaling.http.minReplicas | | <code>0</code> |
| autoscaling.http.maxReplicas | | <code>1</code> |
| app.service.name | | <code>""</code> |
| app.service.namespace | | <code>""</code> |
| app.authSecret.name | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
7 changes: 7 additions & 0 deletions charts/dbgate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Fake keda hostname
*/}}
{{- define "keda.hostname" -}}
{{- printf "%s.%s.kubedb.test" .Values.app.service.name .Values.app.service.namespace | quote }}
{{- end }}
23 changes: 13 additions & 10 deletions charts/dbgate/templates/gw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Gateway
metadata:
name: {{ include "dbgate.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.gateway.nodePort }}
annotations:
port-mapping.gateway.voyagermesh.com/{{ .Values.gateway.port }}: {{ .Values.gateway.nodePort }}
{{- end }}
spec:
gatewayClassName: {{ .Values.gateway.className }}
listeners:
Expand Down Expand Up @@ -30,8 +34,6 @@ spec:
name: {{ include "dbgate.fullname" . }}
namespace: {{ .Release.Namespace }}
sectionName: {{ include "dbgate.fullname" . }}
hostnames:
- "tamal-gateway.keda.kubedb.cloud"
rules:
- backendRefs:
- group: ""
Expand All @@ -44,17 +46,17 @@ spec:
- path:
type: PathPrefix
value: /
# filters:
# - type: RequestHeaderModifier
# requestHeaderModifier:
# set:
# - name: "Host"
# value: "tamal-gateway.keda.kubedb.cloud"
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ include "keda.hostname" . }}
---
{{ if .Values.gateway.referenceGrant.create }}

apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: cert-{{ .Release.Namespace }} # fix naming conflict
name: dbui-cert-{{ .Release.Namespace }}
namespace: {{ .Values.gateway.tlsSecretRef.namespace }}
spec:
from:
Expand All @@ -69,7 +71,7 @@ spec:
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: httproute-{{ .Release.Namespace }} # fix naming conflict
name: dbui-httproute-{{ .Release.Namespace }}
namespace: {{ .Values.keda.proxyService.namespace }}
spec:
from:
Expand All @@ -80,3 +82,4 @@ spec:
- group: ""
kind: Service
name: {{ .Values.keda.proxyService.name }}
{{ end }}
8 changes: 2 additions & 6 deletions charts/dbgate/templates/keda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ metadata:
name: {{ include "dbgate.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- with .Values.hosts }}
hosts:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.pathPrefixes }}
- {{ include "keda.hostname" . }}
pathPrefixes:
{{- toYaml . | nindent 8 }}
{{- end }}
- "/"
targetPendingRequests: {{ .Values.targetPendingRequests }}
scaleTargetRef:
name: {{ include "dbgate.fullname" . }}
Expand Down
17 changes: 12 additions & 5 deletions charts/dbgate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ namespace:

gateway:
className: "ace"
port: 8080
port: 8082
# nodePort: 30080
tlsSecretRef:
name: service-presets-cert
namespace: ace
referenceGrant:
create: true

# This is the namespace that the ingress should be installed
# into. It should be set to the same namespace as the
Expand All @@ -96,12 +98,17 @@ keda:
namespace: "keda"
name: "keda-add-ons-http-interceptor-proxy"
port: 8080
hosts:
- "tamal-gateway.keda.kubedb.cloud"
pathPrefixes:
- "/"
targetPendingRequests: 200
autoscaling:
http:
minReplicas: 0
maxReplicas: 1

# authSecret, Bind CR, HelmRelease CR in same namespace
# db could be in cross namespace
app:
service:
name: ""
namespace: ""
authSecret:
name: ""
6 changes: 5 additions & 1 deletion charts/mongo-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ The following table lists the configurable parameters of the `mongo-ui` chart an
| affinity | | <code>{}</code> |
| namespace.create | | <code>false</code> |
| gateway.className | | <code>"ace"</code> |
| gateway.port | | <code>8083</code> |
| gateway.port | | <code>8082</code> |
| gateway.tlsSecretRef.name | | <code>service-presets-cert</code> |
| gateway.tlsSecretRef.namespace | | <code>ace</code> |
| gateway.referenceGrant.create | | <code>true</code> |
| keda.proxyService.namespace | | <code>"keda"</code> |
| keda.proxyService.name | | <code>"keda-add-ons-http-interceptor-proxy"</code> |
| keda.proxyService.port | | <code>8080</code> |
| targetPendingRequests | | <code>200</code> |
| autoscaling.http.minReplicas | | <code>0</code> |
| autoscaling.http.maxReplicas | | <code>1</code> |
| app.service.name | | <code>""</code> |
| app.service.namespace | | <code>""</code> |
| app.authSecret.name | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
7 changes: 7 additions & 0 deletions charts/mongo-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Fake keda hostname
*/}}
{{- define "keda.hostname" -}}
{{- printf "%s.%s.kubedb.test" .Values.app.service.name .Values.app.service.namespace | quote }}
{{- end }}
23 changes: 13 additions & 10 deletions charts/mongo-ui/templates/gw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Gateway
metadata:
name: {{ include "mongo-ui.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.gateway.nodePort }}
annotations:
port-mapping.gateway.voyagermesh.com/{{ .Values.gateway.port }}: {{ .Values.gateway.nodePort }}
{{- end }}
spec:
gatewayClassName: {{ .Values.gateway.className }}
listeners:
Expand Down Expand Up @@ -30,8 +34,6 @@ spec:
name: {{ include "mongo-ui.fullname" . }}
namespace: {{ .Release.Namespace }}
sectionName: {{ include "mongo-ui.fullname" . }}
hostnames:
- "tamal-gateway.keda.kubedb.cloud"
rules:
- backendRefs:
- group: ""
Expand All @@ -44,17 +46,17 @@ spec:
- path:
type: PathPrefix
value: /
# filters:
# - type: RequestHeaderModifier
# requestHeaderModifier:
# set:
# - name: "Host"
# value: "tamal-gateway.keda.kubedb.cloud"
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ include "keda.hostname" . }}
---
{{ if .Values.gateway.referenceGrant.create }}

apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: cert-{{ .Release.Namespace }}2 # fix naming conflict
name: dbui-cert-{{ .Release.Namespace }}
namespace: {{ .Values.gateway.tlsSecretRef.namespace }}
spec:
from:
Expand All @@ -69,7 +71,7 @@ spec:
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: httproute-{{ .Release.Namespace }}2 # fix naming conflict
name: dbui-httproute-{{ .Release.Namespace }}
namespace: {{ .Values.keda.proxyService.namespace }}
spec:
from:
Expand All @@ -80,3 +82,4 @@ spec:
- group: ""
kind: Service
name: {{ .Values.keda.proxyService.name }}
{{ end }}
8 changes: 2 additions & 6 deletions charts/mongo-ui/templates/keda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ metadata:
name: {{ include "mongo-ui.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- with .Values.hosts }}
hosts:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.pathPrefixes }}
- {{ include "keda.hostname" . }}
pathPrefixes:
{{- toYaml . | nindent 8 }}
{{- end }}
- "/"
targetPendingRequests: {{ .Values.targetPendingRequests }}
scaleTargetRef:
name: {{ include "mongo-ui.fullname" . }}
Expand Down
17 changes: 12 additions & 5 deletions charts/mongo-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ namespace:

gateway:
className: "ace"
port: 8083
port: 8082
# nodePort: 30080
tlsSecretRef:
name: service-presets-cert
namespace: ace
referenceGrant:
create: true

# This is the namespace that the ingress should be installed
# into. It should be set to the same namespace as the
Expand All @@ -96,12 +98,17 @@ keda:
namespace: "keda"
name: "keda-add-ons-http-interceptor-proxy"
port: 8080
hosts:
- "tamal-gateway.keda.kubedb.cloud"
pathPrefixes:
- "/"
targetPendingRequests: 200
autoscaling:
http:
minReplicas: 0
maxReplicas: 1

# authSecret, Bind CR, HelmRelease CR in same namespace
# db could be in cross namespace
app:
service:
name: ""
namespace: ""
authSecret:
name: ""
6 changes: 5 additions & 1 deletion charts/pgadmin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ The following table lists the configurable parameters of the `pgadmin` chart and
| affinity | | <code>{}</code> |
| namespace.create | | <code>false</code> |
| gateway.className | | <code>"ace"</code> |
| gateway.port | | <code>8081</code> |
| gateway.port | | <code>8082</code> |
| gateway.tlsSecretRef.name | | <code>service-presets-cert</code> |
| gateway.tlsSecretRef.namespace | | <code>ace</code> |
| gateway.referenceGrant.create | | <code>true</code> |
| keda.proxyService.namespace | | <code>"keda"</code> |
| keda.proxyService.name | | <code>"keda-add-ons-http-interceptor-proxy"</code> |
| keda.proxyService.port | | <code>8080</code> |
| targetPendingRequests | | <code>200</code> |
| autoscaling.http.minReplicas | | <code>0</code> |
| autoscaling.http.maxReplicas | | <code>1</code> |
| app.service.name | | <code>""</code> |
| app.service.namespace | | <code>""</code> |
| app.authSecret.name | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
7 changes: 7 additions & 0 deletions charts/pgadmin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Fake keda hostname
*/}}
{{- define "keda.hostname" -}}
{{- printf "%s.%s.kubedb.test" .Values.app.service.name .Values.app.service.namespace | quote }}
{{- end }}
23 changes: 13 additions & 10 deletions charts/pgadmin/templates/gw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Gateway
metadata:
name: {{ include "pgadmin.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.gateway.nodePort }}
annotations:
port-mapping.gateway.voyagermesh.com/{{ .Values.gateway.port }}: {{ .Values.gateway.nodePort }}
{{- end }}
spec:
gatewayClassName: {{ .Values.gateway.className }}
listeners:
Expand Down Expand Up @@ -30,8 +34,6 @@ spec:
name: {{ include "pgadmin.fullname" . }}
namespace: {{ .Release.Namespace }}
sectionName: {{ include "pgadmin.fullname" . }}
hostnames:
- "tamal-gateway.keda.kubedb.cloud"
rules:
- backendRefs:
- group: ""
Expand All @@ -44,17 +46,17 @@ spec:
- path:
type: PathPrefix
value: /
# filters:
# - type: RequestHeaderModifier
# requestHeaderModifier:
# set:
# - name: "Host"
# value: "tamal-gateway.keda.kubedb.cloud"
filters:
- type: URLRewrite
urlRewrite:
hostname: {{ include "keda.hostname" . }}
---
{{ if .Values.gateway.referenceGrant.create }}

apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: cert-{{ .Release.Namespace }}2 # fix naming conflict
name: dbui-cert-{{ .Release.Namespace }}
namespace: {{ .Values.gateway.tlsSecretRef.namespace }}
spec:
from:
Expand All @@ -69,7 +71,7 @@ spec:
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: httproute-{{ .Release.Namespace }}2 # fix naming conflict
name: dbui-httproute-{{ .Release.Namespace }}
namespace: {{ .Values.keda.proxyService.namespace }}
spec:
from:
Expand All @@ -80,3 +82,4 @@ spec:
- group: ""
kind: Service
name: {{ .Values.keda.proxyService.name }}
{{ end }}
Loading

0 comments on commit f8ea950

Please sign in to comment.