You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/05/25 07:54:08 UTC
[GitHub] [incubator-devlake] matrixji opened a new pull request, #1999: feat: support helm deployment
matrixji opened a new pull request, #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999
issue: #1991
Signed-off-by: Ji Bin <ma...@live.com>
### ⚠️ Pre Checklist
> Please complete _ALL_ items in this checklist, and remove before submitting
- [x] I have read through the [Contributing](https://devlake.apache.org/community/) Documentation
- [x] This PR is using a `label` (bug, feature etc.)
- [x] My code is has necessary documentation (if appropriate)
- [ ] I have added any relevant tests
- [x] This section (**⚠️ Pre Checklist**) will be removed when submitting PR
# Summary
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes.
Please fill out as many sections below as possible.
-->
### Does this close any open issues?
Partly #1991
### Screenshots
Include any relevant screenshots here.
### Other Information
Any other information that is important to this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
matrixji commented on code in PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999#discussion_r887559088
##########
deployment/helm/templates/statefulsets.yaml:
##########
@@ -0,0 +1,128 @@
+---
+# mysql statefulset
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ include "devlake.fullname" . }}-mysql
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ serviceName: {{ include "devlake.fullname" . }}-mysql
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: mysql
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-mysql
+ image: "{{ .Values.mysql.image.repository }}:{{ .Values.mysql.image.tag }}"
+ imagePullPolicy: {{ .Values.mysql.image.pullPolicy }}
+ ports:
+ - name: mysql
+ containerPort: 3306
+ protocol: TCP
+ livenessProbe:
+ exec:
+ command:
+ - "sh"
+ - "-c"
+ - "mysqladmin ping -u root -p{{ .Values.mysql.rootPassword }}"
+ initialDelaySeconds: 60
+ timeoutSeconds: 30
+ {{- with .Values.mysql.resources }}
+ resources:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ volumeMounts:
+ - mountPath: /var/lib/mysql
+ name: {{ include "devlake.fullname" . }}-mysql-data
+ {{- with .Values.mysql.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.mysql.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.mysql.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ volumeClaimTemplates:
+ - metadata:
+ name: {{ include "devlake.fullname" . }}-mysql-data
+ spec:
+ accessModes: [ "ReadWriteOnce" ]
+ {{- with .Values.mysql.storage.class }}
+ storageClassName: "{{ . }}"
+ {{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.mysql.storage.size }}"
+
+
+---
+# devlake
+# TODO: graceful startup: init container for waiting mysql ready
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ include "devlake.fullname" . }}-lake
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ serviceName: {{ include "devlake.fullname" . }}-lake
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: lake
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-lake
+ image: "{{ .Values.lake.image.repository }}:{{ .Values.lake.image.tag }}"
+ imagePullPolicy: {{ .Values.lake.image.pullPolicy }}
+ ports:
+ - containerPort: 8080
+ livenessProbe:
+ httpGet:
+ path: /blueprints
+ port: 8080
+ scheme: HTTP
+ initialDelaySeconds: 60
+ timeoutSeconds: 30
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ env:
+ - name: DB_URL
+ value: mysql://{{ .Values.mysql.username }}:{{ .Values.mysql.password }}@{{ include "devlake.fullname" . }}-mysql:3306/{{ .Values.mysql.database }}?charset=utf8mb4&parseTime=True
+ command: ["/bin/sh"]
+ # workaround for keep .env in in pv
+ args: ["-c", "touch /app/config/.env; ln -s /app/config/.env /app/.env; lake"]
Review Comment:
Now with ENV_PATH=/app/config/.env, That's smarter, thanks for your advice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] klesh commented on a diff in pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
klesh commented on code in PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999#discussion_r887533193
##########
deployment/helm/templates/statefulsets.yaml:
##########
@@ -0,0 +1,128 @@
+---
+# mysql statefulset
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ include "devlake.fullname" . }}-mysql
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ serviceName: {{ include "devlake.fullname" . }}-mysql
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: mysql
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-mysql
+ image: "{{ .Values.mysql.image.repository }}:{{ .Values.mysql.image.tag }}"
+ imagePullPolicy: {{ .Values.mysql.image.pullPolicy }}
+ ports:
+ - name: mysql
+ containerPort: 3306
+ protocol: TCP
+ livenessProbe:
+ exec:
+ command:
+ - "sh"
+ - "-c"
+ - "mysqladmin ping -u root -p{{ .Values.mysql.rootPassword }}"
+ initialDelaySeconds: 60
+ timeoutSeconds: 30
+ {{- with .Values.mysql.resources }}
+ resources:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ volumeMounts:
+ - mountPath: /var/lib/mysql
+ name: {{ include "devlake.fullname" . }}-mysql-data
+ {{- with .Values.mysql.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.mysql.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.mysql.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ volumeClaimTemplates:
+ - metadata:
+ name: {{ include "devlake.fullname" . }}-mysql-data
+ spec:
+ accessModes: [ "ReadWriteOnce" ]
+ {{- with .Values.mysql.storage.class }}
+ storageClassName: "{{ . }}"
+ {{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.mysql.storage.size }}"
+
+
+---
+# devlake
+# TODO: graceful startup: init container for waiting mysql ready
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ include "devlake.fullname" . }}-lake
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ serviceName: {{ include "devlake.fullname" . }}-lake
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: lake
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-lake
+ image: "{{ .Values.lake.image.repository }}:{{ .Values.lake.image.tag }}"
+ imagePullPolicy: {{ .Values.lake.image.pullPolicy }}
+ ports:
+ - containerPort: 8080
+ livenessProbe:
+ httpGet:
+ path: /blueprints
+ port: 8080
+ scheme: HTTP
+ initialDelaySeconds: 60
+ timeoutSeconds: 30
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ env:
+ - name: DB_URL
+ value: mysql://{{ .Values.mysql.username }}:{{ .Values.mysql.password }}@{{ include "devlake.fullname" . }}-mysql:3306/{{ .Values.mysql.database }}?charset=utf8mb4&parseTime=True
+ command: ["/bin/sh"]
+ # workaround for keep .env in in pv
+ args: ["-c", "touch /app/config/.env; ln -s /app/config/.env /app/.env; lake"]
Review Comment:
Neat!
But we had added `ENV_PATH` environment variable for specifying the location of `.env` file, would you kindly consider using this variable?
##########
deployment/helm/templates/deployments.yaml:
##########
@@ -0,0 +1,82 @@
+---
+# grafana
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "devlake.fullname" . }}-grafana
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: grafana
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-grafana
+ image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}"
+ imagePullPolicy: {{ .Values.grafana.image.pullPolicy }}
+ ports:
+ - containerPort: 3000
+ livenessProbe:
+ httpGet:
+ path: /api/health
+ port: 3000
+ initialDelaySeconds: 30
+ timeoutSeconds: 30
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ env:
+ - name: GF_USERS_ALLOW_SIGN_UP
+ value: 'false'
+ - name: GF_DASHBOARDS_JSON_ENABLED
+ value: 'true'
+ - name: GF_LIVE_ALLOWED_ORIGINS
+ value: '*'
+ - name: MYSQL_URL
+ value: {{ include "devlake.fullname" . }}-mysql:3306
+
+---
+# devlake-ui
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "devlake.fullname" . }}-ui
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: ui
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-ui
+ image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}"
+ imagePullPolicy: {{ .Values.ui.image.pullPolicy }}
+ ports:
+ - containerPort: 80
+ envFrom:
+ - 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
Review Comment:
This should be the public URL of Grafana, which will be sent directly to the user's browser, for the user to click and open up grafana dashboard.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] warren830 merged pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
warren830 merged PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] warren830 commented on pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
warren830 commented on PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999#issuecomment-1137295087
Very nice job, thank you for your contribution. will review it tomorrow
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
matrixji commented on code in PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999#discussion_r887558436
##########
deployment/helm/templates/deployments.yaml:
##########
@@ -0,0 +1,82 @@
+---
+# grafana
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "devlake.fullname" . }}-grafana
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: grafana
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-grafana
+ image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}"
+ imagePullPolicy: {{ .Values.grafana.image.pullPolicy }}
+ ports:
+ - containerPort: 3000
+ livenessProbe:
+ httpGet:
+ path: /api/health
+ port: 3000
+ initialDelaySeconds: 30
+ timeoutSeconds: 30
+ envFrom:
+ - configMapRef:
+ name: {{ include "devlake.fullname" . }}-config
+ env:
+ - name: GF_USERS_ALLOW_SIGN_UP
+ value: 'false'
+ - name: GF_DASHBOARDS_JSON_ENABLED
+ value: 'true'
+ - name: GF_LIVE_ALLOWED_ORIGINS
+ value: '*'
+ - name: MYSQL_URL
+ value: {{ include "devlake.fullname" . }}-mysql:3306
+
+---
+# devlake-ui
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "devlake.fullname" . }}-ui
+ labels:
+ {{- include "devlake.labels" . | nindent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ {{- include "devlake.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "devlake.selectorLabels" . | nindent 8 }}
+ devlakeComponent: ui
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}-ui
+ image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}"
+ imagePullPolicy: {{ .Values.ui.image.pullPolicy }}
+ ports:
+ - containerPort: 80
+ envFrom:
+ - 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
Review Comment:
Yes, fixed. Currently introducing a parameter for it. And later I add ingress support and will overwrite it with ingress's endpoint when ingress is configured.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] matrixji commented on pull request #1999: feat: support helm deployment
Posted by GitBox <gi...@apache.org>.
matrixji commented on PR #1999:
URL: https://github.com/apache/incubator-devlake/pull/1999#issuecomment-1144438945
Comments fixed and rebased from upstream.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org