Skip to content

Commit

Permalink
Update ingress (#234)
Browse files Browse the repository at this point in the history
* adjust ingress

* adjust chart version
  • Loading branch information
ZhangNing10 authored Jan 19, 2024
1 parent b6d2dfe commit 9c9654f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
19 changes: 11 additions & 8 deletions HelmSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,17 @@ Some useful parameters for the chart, you could also check them in values.yaml
| ui.deployment.extraLabels | extra labels for ui's deployment metadata | {} |
| service.type | Service type for exposed service | NodePort |
| service.uiPort | Node port for config ui | 32001 |
| service.ingress.enabled | If enable ingress | false |
| service.ingress.enableHttps | If enable https | false |
| service.ingress.className | Name for ingressClass. leave empty for using default | "" |
| service.ingress.hostname | The hostname/domainname for ingress | localhost |
| service.ingress.prefix | The prefix for endpoints, currently not used | / |
| service.ingress.tlsSecretName | The secret name for tls's certificate for https | "" |
| service.ingress.httpPort | The http port for ingress | 80 |
| service.ingress.httpsPort | The https port for ingress | 443 |
| ingress.enabled | If enable ingress | false |
| ingress.enableHttps | If enable https | false |
| ingress.useDefaultNginx | If use nginx ingress controller | true |
| ingress.className | Name for ingressClass. leave empty for using default | "" |
| ingress.annotations | The ingress annotations | {} |
| ingress.hostname | The hostname/domainname for ingress | localhost |
| ingress.prefix | The prefix for endpoints, currently not used | / |
| ingress.tlsSecretName | The secret name for tls's certificate for https | "" |
| ingress.httpPort | The http port for ingress | 80 |
| ingress.httpsPort | The https port for ingress | 443 |
| ingress.extraPaths | The extra paths for ingress | [] |
| option.database | The database type, valids: mysql | mysql |
| option.connectionSecretName | The database connection details secret name | devlake-mysql-auth |
| option.autoCreateSecret | If let the helm chart create the secret | true |
Expand Down
2 changes: 1 addition & 1 deletion charts/devlake/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ keywords:
type: application

# Chart version
version: 0.20.0-beta7
version: 0.20.0-beta7.1

# devlake version
appVersion: v0.20.0-beta7
Expand Down
21 changes: 12 additions & 9 deletions charts/devlake/templates/ingresses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "devlake.fullname" . -}}
{{- $uiServiceName := printf "%s-%s" $fullName "ui" -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down Expand Up @@ -67,12 +68,12 @@ spec:
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "grafana.fullname" (dict "Values" .Values.grafana "Chart" (dict "Name" "grafana") "Release" .Release ) }}
name: {{ .Values.grafana.ingressServiceName | default ( include "grafana.fullname" (dict "Values" .Values.grafana "Chart" (dict "Name" "grafana") "Release" .Release ) ) }}
port:
number: {{ .Values.grafana.service.port }}
number: {{ .Values.grafana.ingressServicePort | default .Values.grafana.service.port }}
{{- else }}
serviceName: {{ include "grafana.fullname" (dict "Values" .Values.grafana "Chart" (dict "Name" "grafana") "Release" .Release ) }}
servicePort: {{ .Values.grafana.service.port }}
serviceName: {{ .Values.grafana.ingressServiceName | default ( include "grafana.fullname" (dict "Values" .Values.grafana "Chart" (dict "Name" "grafana") "Release" .Release ) ) }}
servicePort: {{ .Values.grafana.ingressServicePort | default .Values.grafana.service.port }}
{{- end }}
{{- end }}
{{- if .Values.ingress.useDefaultNginx }}
Expand All @@ -86,14 +87,16 @@ spec:
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "devlake.fullname" . }}-ui
name: {{ $uiServiceName }}
port:
number: 4000
{{- else }}
serviceName: {{ include "devlake.fullname" . }}-ui
serviceName: {{ $uiServiceName }}
servicePort: 4000
{{- end }}

{{- if .Values.ingress.extraPaths }}
{{- toYaml .Values.ingress.extraPaths | nindent 10 }}
{{- end }}
{{- if and .Values.ingress.useDefaultNginx (not .Values.grafana.enabled) }}
---
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
Expand Down Expand Up @@ -135,11 +138,11 @@ spec:
backend: # dummy to config-ui, actual 302 forearding for external grafana
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "devlake.fullname" . }}-ui
name: {{ $uiServiceName }}
port:
number: 4000
{{- else }}
serviceName: {{ include "devlake.fullname" . }}-ui
serviceName: {{ $uiServiceName }}
servicePort: 4000
{{- end }}
{{- end }}
Expand Down
15 changes: 13 additions & 2 deletions charts/devlake/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ grafana:
persistence:
enabled: true
size: 4Gi
ingressServiceName: ""
ingressServicePort: ""

lake:
image:
Expand Down Expand Up @@ -327,8 +329,7 @@ ingress:
# annotations required for your ingress controller; see the examples below
# for nginx, use the first two lines of annotations
# for alb (w/ external-dns), use the last 5 (6) lines of annotations
annotations:
{}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
#
Expand All @@ -348,6 +349,16 @@ ingress:
# ingress https port
httpsPort: 443

extraPaths: []
# extraPaths:
# - path: /*
# pathType: ImplementationSpecific
# backend:
# service:
# name: ssl-redirect
# port:
# name: use-annotation

option:
# database type, supported: [mysql]
database: mysql
Expand Down

0 comments on commit 9c9654f

Please sign in to comment.