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
80 changes: 40 additions & 40 deletions charts/devlake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,44 +74,44 @@ After deployed, visit devlake: https://devlake-0.example.com:8443, and grafana a

Some useful parameters for the chart, you could also check them in values.yaml

| Parameter | Description | Default |
|-----------|-------------|---------|
| replicaCount | Replica Count for devlake, currently not used | 1 |
| mysql.useExternal | If use external mysql server, currently not used | false |
| mysql.externalServer | External mysql server address | 127.0.0.1 |
| mysql.externalPort | External mysql server port | 3306 |
| mysql.username | username for mysql | merico |
| mysql.password | password for mysql | merico |
| mysql.database | database for mysql | lake |
| mysql.rootPassword | root password for mysql | admin |
| mysql.storage.class | storage class for mysql's volume | "" |
| mysql.storage.size | volume size for mysql's data | 5Gi |
| mysql.image.repository | repository for mysql's image | mysql |
| mysql.image.tag | image tag for mysql's image | 8.0.26 |
| mysql.image.pullPolicy | pullPolicy for mysql's image | IfNotPresent |
| grafana.image.repository | repository for grafana's image | mericodev/grafana |
| grafana.image.tag | image tag for grafana's image | latest |
| grafana.image.pullPolicy | pullPolicy for grafana's image | Always |
| lake.storage.class | storage class for lake's volume | "" |
| lake.storage.size | volume size for lake's data | 100Mi |
| lake.image.repository | repository for lake's image | mericodev/lake |
| lake.image.tag | image tag for lake's image | latest |
| lake.image.pullPolicy | pullPolicy for lake's image | Always |
| ui.image.repository | repository for ui's image | mericodev/config-ui |
| ui.image.tag | image tag for ui's image | latest |
| ui.image.pullPolicy | pullPolicy for ui's image | Always |
| ui.basicAuth.enabled | If the basic auth in ui is enabled | false |
| ui.basicAuth.user | The user name for the basic auth | "admin" |
| ui.basicAuth.password | The password for the basic auth | "admin" |
| service.type | Service type for exposed service | NodePort |
| service.uiPort | Service port for config ui | 32001 |
| service.ingress.enabled | If enable ingress | false |
| service.ingress.enableHttps | If enable https | false |
| service.ingress.className | The class name for ingressClass. If leave empty, the default IngressClass will be used | "" |
| service.ingress.hostname | The hostname/domainname for ingress | localhost |
| service.ingress.prefix | The prefix for endpoints, currently not supported due to devlake's implementation | / |
| service.ingress.tlsSecretName | The secret name for tls's certificate, required when https enabled | "" |
| service.ingress.httpPort | The http port for ingress | 80 |
| service.ingress.httpsPort | The https port for ingress | 443 |
| option.localtime | The hostpath for mount as /etc/localtime | /etc/localtime |
| Parameter | Description | Default |
|-----------|----------------------------------------------------------------------------------------|---------|
| replicaCount | Replica Count for devlake, currently not used | 1 |
| mysql.useExternal | If use external mysql server, set true | false |
| mysql.externalServer | External mysql server address | 127.0.0.1 |
| mysql.externalPort | External mysql server port | 3306 |
| mysql.username | username for mysql | merico |
| mysql.password | password for mysql | merico |
| mysql.database | database for mysql | lake |
| mysql.rootPassword | root password for mysql | admin |
| mysql.storage.class | storage class for mysql's volume | "" |
| mysql.storage.size | volume size for mysql's data | 5Gi |
| mysql.image.repository | repository for mysql's image | mysql |
| mysql.image.tag | image tag for mysql's image | 8.0.26 |
| mysql.image.pullPolicy | pullPolicy for mysql's image | IfNotPresent |
| grafana.image.repository | repository for grafana's image | mericodev/grafana |
| grafana.image.tag | image tag for grafana's image | latest |
| grafana.image.pullPolicy | pullPolicy for grafana's image | Always |
| lake.storage.class | storage class for lake's volume | "" |
| lake.storage.size | volume size for lake's data | 100Mi |
| lake.image.repository | repository for lake's image | mericodev/lake |
| lake.image.tag | image tag for lake's image | latest |
| lake.image.pullPolicy | pullPolicy for lake's image | Always |
| ui.image.repository | repository for ui's image | mericodev/config-ui |
| ui.image.tag | image tag for ui's image | latest |
| ui.image.pullPolicy | pullPolicy for ui's image | Always |
| ui.basicAuth.enabled | If the basic auth in ui is enabled | false |
| ui.basicAuth.user | The user name for the basic auth | "admin" |
| ui.basicAuth.password | The password for the basic auth | "admin" |
| service.type | Service type for exposed service | NodePort |
| service.uiPort | Service port for config ui | 32001 |
| service.ingress.enabled | If enable ingress | false |
| service.ingress.enableHttps | If enable https | false |
| service.ingress.className | The class name for ingressClass. If leave empty, the default IngressClass will be used | "" |
| service.ingress.hostname | The hostname/domainname for ingress | localhost |
| service.ingress.prefix | The prefix for endpoints, currently not supported due to devlake's implementation | / |
| service.ingress.tlsSecretName | The secret name for tls's certificate, required when https enabled | "" |
| service.ingress.httpPort | The http port for ingress | 80 |
| service.ingress.httpsPort | The https port for ingress | 443 |
| option.localtime | The hostpath for mount as /etc/localtime | /etc/localtime |

40 changes: 23 additions & 17 deletions charts/devlake/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{/*
Expand the name of the chart.
*/}}
Expand Down Expand Up @@ -112,3 +95,26 @@ The ui endpoint
{{- end }}
{{- end }}
{{- end }}

{{/*
The mysql server
*/}}
{{- define "mysql.server" -}}
{{- if .Values.mysql.useExternal }}
{{- .Values.mysql.externalServer }}
{{- else }}
{{- print (include "devlake.fullname" . ) "-mysql" }}
{{- end }}
{{- end }}


{{/*
The mysql port
*/}}
{{- define "mysql.port" -}}
{{- if .Values.mysql.useExternal }}
{{- .Values.mysql.externalPort }}
{{- else }}
{{- 3306 }}
{{- end }}
{{- end }}
44 changes: 21 additions & 23 deletions charts/devlake/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ spec:
- 'sh'
- '-c'
- |
until nc -z -w 2 {{ include "devlake.fullname" . }}-mysql 3306 && echo mysql is ready ; do
until nc -z -w 2 {{ include "mysql.server" . }} {{ include "mysql.port" . }} ; do
echo wait for mysql ready ...
sleep 2
done
echo mysql is ready
containers:
- name: grafana
image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}"
Expand All @@ -67,16 +69,16 @@ spec:
- configMapRef:
name: {{ include "devlake.fullname" . }}-config
env:
- name: GF_SERVER_ROOT_URL
value: "%(protocol)s://%(domain)s:%(http_port)s/grafana/"
- name: MYSQL_URL
value: {{ include "devlake.fullname" . }}-mysql:3306
- name: GF_SERVER_ROOT_URL
value: "%(protocol)s://%(domain)s:%(http_port)s/grafana/"
- name: MYSQL_URL
value: {{ include "mysql.server" . }}:{{ include "mysql.port" . }}
volumes:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-grafana-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-grafana-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- end }}

---
Expand Down Expand Up @@ -108,20 +110,16 @@ spec:
- configMapRef:
name: {{ include "devlake.fullname" . }}-config
env:
- name: DEVLAKE_ENDPOINT
# TODO: remove hardcoded `cluster.local`
value: {{ include "devlake.fullname" . }}-lake.{{ .Release.Namespace }}.svc.cluster.local:8080
- name: GRAFANA_ENDPOINT
value: {{ include "devlake.fullname" . }}-grafana.{{ .Release.Namespace }}.svc.cluster.local:3000
# - name: ADMIN_USER
# value: "admin"
# - name: ADMIN_PASS
# value: "admin"
- name: DEVLAKE_ENDPOINT
# TODO: remove hardcoded `cluster.local`
value: {{ include "devlake.fullname" . }}-lake.{{ .Release.Namespace }}.svc.cluster.local:8080
- name: GRAFANA_ENDPOINT
value: {{ include "devlake.fullname" . }}-grafana.{{ .Release.Namespace }}.svc.cluster.local:3000
volumeMounts:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-ui-localtime
mountPath: /etc/localtime
readOnly: true
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-ui-localtime
mountPath: /etc/localtime
readOnly: true
{{- end }}
volumes:
{{- if ne .Values.option.localtime "" }}
Expand Down
2 changes: 2 additions & 0 deletions charts/devlake/templates/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
# mysql services
---
{{- if not .Values.mysql.useExternal }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -31,6 +32,7 @@ spec:
name: mysql
port: 3306
targetPort: 3306
{{- end }}

# grafana services
---
Expand Down
1 change: 1 addition & 0 deletions charts/devlake/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
---
# mysql statefulset
{{- if not .Values.mysql.useExternal }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down
1 change: 0 additions & 1 deletion charts/devlake/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ replicaCount: 1
mysql:
# if use external mysql server, please set true
# by default using false, chart will create a single mysql instance
# TODO(matrixji): add support external mysql server
useExternal: false

# the external mysql server address
Expand Down