diff --git a/charts/dbgate/README.md b/charts/dbgate/README.md index 2848927c..978ade57 100644 --- a/charts/dbgate/README.md +++ b/charts/dbgate/README.md @@ -67,15 +67,19 @@ The following table lists the configurable parameters of the `dbgate` chart and | affinity | | {} | | namespace.create | | false | | gateway.className | | "ace" | -| gateway.port | | 8080 | +| gateway.port | | 8082 | | gateway.tlsSecretRef.name | | service-presets-cert | | gateway.tlsSecretRef.namespace | | ace | +| gateway.referenceGrant.create | | true | | keda.proxyService.namespace | | "keda" | | keda.proxyService.name | | "keda-add-ons-http-interceptor-proxy" | | keda.proxyService.port | | 8080 | | targetPendingRequests | | 200 | | autoscaling.http.minReplicas | | 0 | | autoscaling.http.maxReplicas | | 1 | +| app.service.name | | "" | +| app.service.namespace | | "" | +| app.authSecret.name | | "" | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/dbgate/templates/_helpers.tpl b/charts/dbgate/templates/_helpers.tpl index 861c7e46..02c2437e 100644 --- a/charts/dbgate/templates/_helpers.tpl +++ b/charts/dbgate/templates/_helpers.tpl @@ -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 }} diff --git a/charts/dbgate/templates/gw.yaml b/charts/dbgate/templates/gw.yaml index 1941d48d..39fe660e 100644 --- a/charts/dbgate/templates/gw.yaml +++ b/charts/dbgate/templates/gw.yaml @@ -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: @@ -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: "" @@ -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: @@ -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: @@ -80,3 +82,4 @@ spec: - group: "" kind: Service name: {{ .Values.keda.proxyService.name }} +{{ end }} diff --git a/charts/dbgate/templates/keda.yaml b/charts/dbgate/templates/keda.yaml index 6aa0a3fc..2266082b 100644 --- a/charts/dbgate/templates/keda.yaml +++ b/charts/dbgate/templates/keda.yaml @@ -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" . }} diff --git a/charts/dbgate/values.yaml b/charts/dbgate/values.yaml index 08ed6ab1..8475749e 100644 --- a/charts/dbgate/values.yaml +++ b/charts/dbgate/values.yaml @@ -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 @@ -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: "" diff --git a/charts/mongo-ui/README.md b/charts/mongo-ui/README.md index b8f30dd9..eca713d9 100644 --- a/charts/mongo-ui/README.md +++ b/charts/mongo-ui/README.md @@ -68,15 +68,19 @@ The following table lists the configurable parameters of the `mongo-ui` chart an | affinity | | {} | | namespace.create | | false | | gateway.className | | "ace" | -| gateway.port | | 8083 | +| gateway.port | | 8082 | | gateway.tlsSecretRef.name | | service-presets-cert | | gateway.tlsSecretRef.namespace | | ace | +| gateway.referenceGrant.create | | true | | keda.proxyService.namespace | | "keda" | | keda.proxyService.name | | "keda-add-ons-http-interceptor-proxy" | | keda.proxyService.port | | 8080 | | targetPendingRequests | | 200 | | autoscaling.http.minReplicas | | 0 | | autoscaling.http.maxReplicas | | 1 | +| app.service.name | | "" | +| app.service.namespace | | "" | +| app.authSecret.name | | "" | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/mongo-ui/templates/_helpers.tpl b/charts/mongo-ui/templates/_helpers.tpl index 261f17ad..0c90afae 100644 --- a/charts/mongo-ui/templates/_helpers.tpl +++ b/charts/mongo-ui/templates/_helpers.tpl @@ -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 }} diff --git a/charts/mongo-ui/templates/gw.yaml b/charts/mongo-ui/templates/gw.yaml index 5cc3f4f3..2d690b75 100644 --- a/charts/mongo-ui/templates/gw.yaml +++ b/charts/mongo-ui/templates/gw.yaml @@ -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: @@ -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: "" @@ -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: @@ -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: @@ -80,3 +82,4 @@ spec: - group: "" kind: Service name: {{ .Values.keda.proxyService.name }} +{{ end }} diff --git a/charts/mongo-ui/templates/keda.yaml b/charts/mongo-ui/templates/keda.yaml index ba95b18c..e34fc407 100644 --- a/charts/mongo-ui/templates/keda.yaml +++ b/charts/mongo-ui/templates/keda.yaml @@ -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" . }} diff --git a/charts/mongo-ui/values.yaml b/charts/mongo-ui/values.yaml index 13dc577d..5d96f5b5 100644 --- a/charts/mongo-ui/values.yaml +++ b/charts/mongo-ui/values.yaml @@ -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 @@ -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: "" diff --git a/charts/pgadmin/README.md b/charts/pgadmin/README.md index d980df56..aa9ee646 100644 --- a/charts/pgadmin/README.md +++ b/charts/pgadmin/README.md @@ -68,15 +68,19 @@ The following table lists the configurable parameters of the `pgadmin` chart and | affinity | | {} | | namespace.create | | false | | gateway.className | | "ace" | -| gateway.port | | 8081 | +| gateway.port | | 8082 | | gateway.tlsSecretRef.name | | service-presets-cert | | gateway.tlsSecretRef.namespace | | ace | +| gateway.referenceGrant.create | | true | | keda.proxyService.namespace | | "keda" | | keda.proxyService.name | | "keda-add-ons-http-interceptor-proxy" | | keda.proxyService.port | | 8080 | | targetPendingRequests | | 200 | | autoscaling.http.minReplicas | | 0 | | autoscaling.http.maxReplicas | | 1 | +| app.service.name | | "" | +| app.service.namespace | | "" | +| app.authSecret.name | | "" | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/pgadmin/templates/_helpers.tpl b/charts/pgadmin/templates/_helpers.tpl index 4b9c4abf..7201cddb 100644 --- a/charts/pgadmin/templates/_helpers.tpl +++ b/charts/pgadmin/templates/_helpers.tpl @@ -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 }} diff --git a/charts/pgadmin/templates/gw.yaml b/charts/pgadmin/templates/gw.yaml index cb0edbca..1545991b 100644 --- a/charts/pgadmin/templates/gw.yaml +++ b/charts/pgadmin/templates/gw.yaml @@ -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: @@ -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: "" @@ -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: @@ -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: @@ -80,3 +82,4 @@ spec: - group: "" kind: Service name: {{ .Values.keda.proxyService.name }} +{{ end }} diff --git a/charts/pgadmin/templates/keda.yaml b/charts/pgadmin/templates/keda.yaml index b8da7d3c..0165651d 100644 --- a/charts/pgadmin/templates/keda.yaml +++ b/charts/pgadmin/templates/keda.yaml @@ -4,14 +4,10 @@ metadata: name: {{ include "pgadmin.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 "pgadmin.fullname" . }} diff --git a/charts/pgadmin/values.yaml b/charts/pgadmin/values.yaml index 8fef55cf..a1d1c2ff 100644 --- a/charts/pgadmin/values.yaml +++ b/charts/pgadmin/values.yaml @@ -81,11 +81,13 @@ namespace: gateway: className: "ace" - port: 8081 + 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 @@ -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: "" diff --git a/charts/phpmyadmin/README.md b/charts/phpmyadmin/README.md index 3989b83c..d2dfefed 100644 --- a/charts/phpmyadmin/README.md +++ b/charts/phpmyadmin/README.md @@ -71,12 +71,16 @@ The following table lists the configurable parameters of the `phpmyadmin` chart | gateway.port | | 8082 | | gateway.tlsSecretRef.name | | service-presets-cert | | gateway.tlsSecretRef.namespace | | ace | +| gateway.referenceGrant.create | | true | | keda.proxyService.namespace | | "keda" | | keda.proxyService.name | | "keda-add-ons-http-interceptor-proxy" | | keda.proxyService.port | | 8080 | | targetPendingRequests | | 200 | | autoscaling.http.minReplicas | | 0 | | autoscaling.http.maxReplicas | | 1 | +| app.service.name | | "" | +| app.service.namespace | | "" | +| app.authSecret.name | | "" | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/phpmyadmin/templates/_helpers.tpl b/charts/phpmyadmin/templates/_helpers.tpl index 8cace0f4..4b955501 100644 --- a/charts/phpmyadmin/templates/_helpers.tpl +++ b/charts/phpmyadmin/templates/_helpers.tpl @@ -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 }} diff --git a/charts/phpmyadmin/templates/gw.yaml b/charts/phpmyadmin/templates/gw.yaml index a50084d7..150d80eb 100644 --- a/charts/phpmyadmin/templates/gw.yaml +++ b/charts/phpmyadmin/templates/gw.yaml @@ -3,6 +3,10 @@ kind: Gateway metadata: name: {{ include "phpmyadmin.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: @@ -30,8 +34,6 @@ spec: name: {{ include "phpmyadmin.fullname" . }} namespace: {{ .Release.Namespace }} sectionName: {{ include "phpmyadmin.fullname" . }} - hostnames: - - "tamal-gateway.keda.kubedb.cloud" rules: - backendRefs: - group: "" @@ -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: @@ -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: @@ -80,3 +82,4 @@ spec: - group: "" kind: Service name: {{ .Values.keda.proxyService.name }} +{{ end }} diff --git a/charts/phpmyadmin/templates/keda.yaml b/charts/phpmyadmin/templates/keda.yaml index fe0d2a8e..07cc2050 100644 --- a/charts/phpmyadmin/templates/keda.yaml +++ b/charts/phpmyadmin/templates/keda.yaml @@ -4,14 +4,10 @@ metadata: name: {{ include "phpmyadmin.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 "phpmyadmin.fullname" . }} diff --git a/charts/phpmyadmin/values.yaml b/charts/phpmyadmin/values.yaml index 4eb87a66..c6e2cdf9 100644 --- a/charts/phpmyadmin/values.yaml +++ b/charts/phpmyadmin/values.yaml @@ -86,6 +86,8 @@ gateway: 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 @@ -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: ""