Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add TZ option and remote timezone option #113

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 3 additions & 6 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ jobs:
helm install --wait --timeout 300s deploy-test charts/devlake \
--set service.uiPort=30000 \
--set mysql.useExternal=true \
--set mysql.externalServer=mysql \
--set option.localtime=""
--set mysql.externalServer=mysql
kubectl get pods -o wide
kubectl get services -o wide

Expand All @@ -78,8 +77,7 @@ jobs:
echo Node IP: ${NODE_IP}
helm install --wait --timeout 300s deploy-test charts/devlake \
--set service.uiPort=30000 \
--set mysql.image.tag=8-debian \
--set option.localtime=""
--set mysql.image.tag=8-debian
kubectl get pods -o wide
kubectl get services -o wide

Expand All @@ -90,8 +88,7 @@ jobs:
# echo Node IP: ${NODE_IP}
# helm install --wait --timeout 300s deploy-test charts/devlake \
# --set service.uiPort=30000 \
# --set option.database=pgsql \
# --set option.localtime=""
# --set option.database=pgsql
# kubectl get pods -o wide
# kubectl get services -o wide

Expand Down
88 changes: 44 additions & 44 deletions HelmSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,50 +112,50 @@ 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 |
| imageTag | The version tag for all images | see Values.yaml |
| 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 |
| mysql.image.pullPolicy | pullPolicy for mysql's image | IfNotPresent |
| grafana.image.repository | repository for grafana's image | apache/devlake-dashboard |
| grafana.image.pullPolicy | pullPolicy for grafana's image | Always |
| grafana.useExternal | If use external grafana server | false |
| grafana.externalUrl | external grafana server if use external | "" |
| 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 | apache/devlake |
| lake.image.pullPolicy | pullPolicy for lake's image | Always |
| lake.loggingDir | log dir for the lake server | /app/logs |
| lake.loggingLevel | log level for the lake server | info |
| lake.dotenv | initial configurations for injecting to lake's .env | see Values.yaml |
| ui.image.repository | repository for ui's image | apache/devlake-config-ui |
| 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 | 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 |
| option.localtime | The hostpath for mount as /etc/localtime | /etc/localtime |
| option.database | The database type, valids: mysql | mysql |
| Parameter | Description | Default |
|-------------------------------|------------------------------------------------------|--------------------------|
| replicaCount | Replica Count for devlake, currently not used | 1 |
| imageTag | The version tag for all images | see Values.yaml |
| 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 |
| mysql.image.pullPolicy | pullPolicy for mysql's image | IfNotPresent |
| grafana.image.repository | repository for grafana's image | apache/devlake-dashboard |
| grafana.image.pullPolicy | pullPolicy for grafana's image | Always |
| grafana.useExternal | If use external grafana server | false |
| grafana.externalUrl | external grafana server if use external | "" |
| 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 | apache/devlake |
| lake.image.pullPolicy | pullPolicy for lake's image | Always |
| lake.loggingDir | log dir for the lake server | /app/logs |
| lake.loggingLevel | log level for the lake server | info |
| lake.dotenv | initial configurations for injecting to lake's .env | see Values.yaml |
| ui.image.repository | repository for ui's image | apache/devlake-config-ui |
| 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 | 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 |
| option.TZ | The timezone | Asia/Shanghai |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great. just one discussion: do we need to use UTC as our default timezone?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klesh @warren830 What's your opinion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTC has a special meaning for developers.
It would be better to choose a neutral timezone to make it clear that it should be set by users to their own timezone.
I suggest that we use America/Cayman as the placeholder

| option.database | The database type, valids: mysql | mysql |

## FAQ
1. Can I use a managed Cloud database service instead of running database in docker?
Expand Down
1 change: 1 addition & 0 deletions charts/devlake/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ data:
{{- if .Values.ui.basicAuth.enabled }}
ADMIN_USER: "{{ .Values.ui.basicAuth.user }}"
ADMIN_PASS: "{{ .Values.ui.basicAuth.password }}"
TZ: "{{ .Values.option.TZ }}"
{{- end }}

---
Expand Down
22 changes: 0 additions & 22 deletions charts/devlake/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ spec:
initialDelaySeconds: 30
timeoutSeconds: 30
volumeMounts:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-grafana-localtime
mountPath: /etc/localtime
readOnly: true
{{- end }}
- name: {{ include "devlake.fullname" . }}-grafana-datasource-config
mountPath: /etc/grafana/provisioning/datasources/datasource.yml
subPath: grafana-datasource.yml
Expand Down Expand Up @@ -83,12 +78,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-grafana-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- end }}
- name: {{ include "devlake.fullname" . }}-grafana-datasource-config
configMap:
name: {{ include "devlake.fullname" . }}-grafana-datasource
Expand Down Expand Up @@ -133,11 +122,6 @@ spec:
value: {{ include "devlake.fullname" . }}-grafana.{{ .Release.Namespace }}.svc.cluster.local:3000
{{- end }}
volumeMounts:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-ui-localtime
mountPath: /etc/localtime
readOnly: true
{{- end }}
- name: {{ include "devlake.fullname" . }}-nginx-conf-config
mountPath: /etc/nginx/conf.d/default.conf.tpl
subPath: default.conf.tpl
Expand All @@ -158,12 +142,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-ui-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- end }}
- name: {{ include "devlake.fullname" . }}-nginx-conf-config
configMap:
name: {{ include "devlake.fullname" . }}-nginx-conf
36 changes: 0 additions & 36 deletions charts/devlake/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/mysql
name: {{ include "devlake.fullname" . }}-mysql-data
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-mysql-localtime
mountPath: /etc/localtime
readOnly: true
{{- end }}
{{- with .Values.mysql.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -92,13 +87,6 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-mysql-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- end }}
volumeClaimTemplates:
- metadata:
name: {{ include "devlake.fullname" . }}-mysql-data
Expand Down Expand Up @@ -165,11 +153,6 @@ spec:
# volumeMounts:
# - mountPath: /var/lib/postgresql
# name: {{ include "devlake.fullname" . }}-pgsql-data
# {{- if ne .Values.option.localtime "" }}
# - name: {{ include "devlake.fullname" . }}-pgsql-localtime
# mountPath: /etc/localtime
# readOnly: true
# {{- end }}
# {{- with .Values.pgsql.nodeSelector }}
# nodeSelector:
# {{- toYaml . | nindent 8 }}
Expand All @@ -182,13 +165,6 @@ spec:
# tolerations:
# {{- toYaml . | nindent 8 }}
# {{- end }}
# volumes:
# {{- if ne .Values.option.localtime "" }}
# - name: {{ include "devlake.fullname" . }}-pgsql-localtime
# hostPath:
# path: {{ .Values.option.localtime }}
# type: File
# {{- end }}
# volumeClaimTemplates:
# - metadata:
# name: {{ include "devlake.fullname" . }}-pgsql-data
Expand Down Expand Up @@ -277,11 +253,6 @@ spec:
volumeMounts:
- mountPath: /app/config
name: {{ include "devlake.fullname" . }}-lake-config
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-lake-localtime
mountPath: /etc/localtime
readOnly: true
{{- end }}
{{- with .Values.lake.resources }}
resources:
{{- toYaml . | nindent 12 }}
Expand All @@ -302,13 +273,6 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ne .Values.option.localtime "" }}
- name: {{ include "devlake.fullname" . }}-lake-localtime
hostPath:
path: {{ .Values.option.localtime }}
type: File
{{- end }}
volumeClaimTemplates:
- metadata:
name: {{ include "devlake.fullname" . }}-lake-config
Expand Down
4 changes: 2 additions & 2 deletions charts/devlake/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ ingress:


option:
# localtime zone info from host path.
localtime: /etc/localtime
# timezone
TZ: Asia/Shanghai

# database type, supported: [mysql]
database: mysql