You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2022/06/27 06:35:32 UTC

[incubator-devlake] branch main updated: fix: add mount localtime while deploy with helm (#2291)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new f74acd02 fix: add mount localtime while deploy with helm (#2291)
f74acd02 is described below

commit f74acd02eae04d9baee6ba28b6aee5d79427e54e
Author: Ji Bin <ma...@live.com>
AuthorDate: Mon Jun 27 14:35:27 2022 +0800

    fix: add mount localtime while deploy with helm (#2291)
    
    Signed-off-by: Ji Bin <ma...@live.com>
---
 .github/workflows/deploy-test.yml           |  9 ++++++---
 deployment/helm/README.md                   |  2 ++
 deployment/helm/templates/deployments.yaml  | 24 ++++++++++++++++++++++++
 deployment/helm/templates/statefulsets.yaml | 25 +++++++++++++++++++++++++
 deployment/helm/values.yaml                 |  6 ++++++
 5 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml
index 3e05c61c..4956bf35 100644
--- a/.github/workflows/deploy-test.yml
+++ b/.github/workflows/deploy-test.yml
@@ -48,10 +48,11 @@ jobs:
         run: |
           export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
           echo Node IP: ${NODE_IP}
-          helm install --wait --timeout 600s deploy-test deployment/helm \
+          helm install --wait --timeout 300s deploy-test deployment/helm \
             --set service.uiPort=30000 \
             --set service.grafanaPort=30001 \
-            --set service.grafanaEndpoint=http://${NODE_IP}:30001
+            --set service.grafanaEndpoint=http://${NODE_IP}:30001 \
+            --set option.localtime=""
           kubectl get pods -o wide
           kubectl get services -o wide
 
@@ -83,7 +84,9 @@ jobs:
         if: ${{ always() }}
         run: |
           for pod in $(kubectl get pods -o jsonpath='{.items[*].metadata.name}') ; do
+            echo describe for $pod
+            kubectl describe pod $pod
             echo logs for $pod
-            kubectl logs $pod
+            kubectl logs $pod || echo ""
           done
 
diff --git a/deployment/helm/README.md b/deployment/helm/README.md
index f7fc8866..559d28ec 100644
--- a/deployment/helm/README.md
+++ b/deployment/helm/README.md
@@ -109,3 +109,5 @@ Some useful parameters for the chart, you could also check them in values.yaml
 | 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  |
+
diff --git a/deployment/helm/templates/deployments.yaml b/deployment/helm/templates/deployments.yaml
index b4893bcf..b00a61d3 100644
--- a/deployment/helm/templates/deployments.yaml
+++ b/deployment/helm/templates/deployments.yaml
@@ -61,6 +61,11 @@ spec:
             - mountPath: /etc/grafana/grafana.ini
               name: {{ include "devlake.fullname" . }}-grafana-config
               subPath: grafana.ini
+            {{- if ne .Values.option.localtime "" }}
+            - name: {{ include "devlake.fullname" . }}-grafana-localtime
+              mountPath: /etc/localtime
+              readOnly: true
+            {{- end }}
           envFrom:
             - configMapRef:
                 name: {{ include "devlake.fullname" . }}-config
@@ -78,6 +83,12 @@ spec:
             defaultMode: 420
             name: {{ include "devlake.fullname" . }}-grafana-config
           name: {{ include "devlake.fullname" . }}-grafana-config
+        {{- if ne .Values.option.localtime "" }}
+        - name: {{ include "devlake.fullname" . }}-grafana-localtime
+          hostPath:
+            path: {{ .Values.option.localtime }}
+            type: File
+        {{- end }}
 
 ---
 # devlake-ui
@@ -117,3 +128,16 @@ spec:
             #   value: "admin"
             # - name: ADMIN_PASS
             #   value: "admin"
+          volumeMounts:
+            {{- if ne .Values.option.localtime "" }}
+            - name: {{ include "devlake.fullname" . }}-ui-localtime
+              mountPath: /etc/localtime
+              readOnly: true
+            {{- end }}
+      volumes:
+        {{- if ne .Values.option.localtime "" }}
+        - name: {{ include "devlake.fullname" . }}-ui-localtime
+          hostPath:
+            path: {{ .Values.option.localtime }}
+            type: File
+        {{- end }}
diff --git a/deployment/helm/templates/statefulsets.yaml b/deployment/helm/templates/statefulsets.yaml
index 09c03e05..cbb68603 100644
--- a/deployment/helm/templates/statefulsets.yaml
+++ b/deployment/helm/templates/statefulsets.yaml
@@ -68,6 +68,12 @@ spec:
           volumeMounts:
             - mountPath: /var/lib/mysql
               name: {{ include "devlake.fullname" . }}-mysql-data
+          volumeMounts:
+            {{- 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 }}
@@ -80,6 +86,13 @@ 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
@@ -148,6 +161,18 @@ 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 }}
+      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
diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml
index f49181c0..81bb74b4 100644
--- a/deployment/helm/values.yaml
+++ b/deployment/helm/values.yaml
@@ -150,3 +150,9 @@ ingress:
   httpPort: 80
   # ingress https port
   httpsPort: 443
+
+
+option:
+  # localtime zone info from host path.
+  localtime: /etc/localtime
+