Skip to content

Commit

Permalink
adjust env parts (#195)
Browse files Browse the repository at this point in the history
* adjust env parts

* adjust comment
  • Loading branch information
ZhangNing10 authored Oct 25, 2023
1 parent bbdeb29 commit 9e3c7e7
Show file tree
Hide file tree
Showing 55 changed files with 4,916 additions and 28 deletions.
3 changes: 2 additions & 1 deletion HelmSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Some useful parameters for the chart, you could also check them in values.yaml
| ----------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------ |
| replicaCount | Replica Count for devlake, currently not used | 1 |
| imageTag | The version tag for all images | see Values.yaml |
| envs | The common envs for all pods | {TZ: "UTC"} |
| commonEnvs | The common envs for all pods except grafana | {TZ: "UTC"} |
| 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 |
Expand All @@ -161,6 +161,7 @@ Some useful parameters for the chart, you could also check them in values.yaml
| lake.image.pullPolicy | pullPolicy for lake's image | Always |
| lake.port | the port of devlake backend | 8080 |
| lake.envs | initial envs for lake | see Values.yaml |
| lake.extraEnvsFromSecret | existing secret name of extra envs | "" |
| lake.encryptionSecret.secretName | the k8s secret name for ENCRYPTION_SECRET | "" |
| lake.encryptionSecret.secret | the secret for ENCRYPTION_SECRET | "" |
| lake.encryptionSecret.autoCreateSecret | whether let the helm chart create the secret | true |
Expand Down
Binary file removed charts/devlake/charts/grafana-6.56.6.tgz
Binary file not shown.
23 changes: 23 additions & 0 deletions charts/devlake/charts/grafana/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.vscode
.project
.idea/
*.tmproj
OWNERS
29 changes: 29 additions & 0 deletions charts/devlake/charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
annotations:
artifacthub.io/links: |
- name: Chart Source
url: https://github.com/grafana/helm-charts
- name: Upstream Project
url: https://github.com/grafana/grafana
apiVersion: v2
appVersion: 9.5.2
description: The leading tool for querying and visualizing time series and metrics.
home: https://grafana.net
icon: https://raw.githubusercontent.com/grafana/grafana/master/public/img/logo_transparent_400x.png
kubeVersion: ^1.8.0-0
maintainers:
- email: [email protected]
name: zanhsieh
- email: [email protected]
name: rtluckie
- email: [email protected]
name: maorfr
- email: [email protected]
name: Xtigyro
- email: [email protected]
name: torstenwalter
name: grafana
sources:
- https://github.com/grafana/grafana
- https://github.com/grafana/helm-charts
type: application
version: 6.56.6
685 changes: 685 additions & 0 deletions charts/devlake/charts/grafana/README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions charts/devlake/charts/grafana/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Leave this file empty to ensure that CI runs builds against the default configuration in values.yaml.
16 changes: 16 additions & 0 deletions charts/devlake/charts/grafana/ci/with-affinity-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: grafana-test
app.kubernetes.io/name: grafana
topologyKey: failure-domain.beta.kubernetes.io/zone
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: grafana-test
app.kubernetes.io/name: grafana
topologyKey: kubernetes.io/hostname
53 changes: 53 additions & 0 deletions charts/devlake/charts/grafana/ci/with-dashboard-json-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
dashboards:
my-provider:
my-awesome-dashboard:
# An empty but valid dashboard
json: |
{
"__inputs": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.3.5"
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"links": [],
"panels": [],
"schemaVersion": 19,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s"]
},
"timezone": "",
"title": "Dummy Dashboard",
"uid": "IdcYQooWk",
"version": 1
}
datasource: Prometheus
19 changes: 19 additions & 0 deletions charts/devlake/charts/grafana/ci/with-dashboard-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dashboards:
my-provider:
my-awesome-dashboard:
gnetId: 10000
revision: 1
datasource: Prometheus
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'my-provider'
orgId: 1
folder: ''
type: file
updateIntervalSeconds: 10
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/my-provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extraConfigmapMounts:
- name: '{{ include "grafana.fullname" . }}'
configMap: '{{ include "grafana.fullname" . }}'
mountPath: /var/lib/grafana/dashboards/test-dashboard.json
# This is not a realistic test, but for this we only care about extraConfigmapMounts not being empty and pointing to an existing ConfigMap
subPath: grafana.ini
readOnly: true
19 changes: 19 additions & 0 deletions charts/devlake/charts/grafana/ci/with-image-renderer-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
podLabels:
customLableA: Aaaaa
imageRenderer:
enabled: true
env:
RENDERING_ARGS: --disable-gpu,--window-size=1280x758
RENDERING_MODE: clustered
podLabels:
customLableB: Bbbbb
networkPolicy:
limitIngress: true
limitEgress: true
resources:
limits:
cpu: 1000m
memory: 1000Mi
requests:
cpu: 500m
memory: 50Mi
3 changes: 3 additions & 0 deletions charts/devlake/charts/grafana/ci/with-persistence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
persistence:
type: pvc
enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
55 changes: 55 additions & 0 deletions charts/devlake/charts/grafana/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
1. Get your '{{ .Values.adminUser }}' user password by running:

kubectl get secret --namespace {{ include "grafana.namespace" . }} {{ .Values.admin.existingSecret | default (include "grafana.fullname" .) }} -o jsonpath="{.data.{{ .Values.admin.passwordKey | default "admin-password" }}}" | base64 --decode ; echo


2. The Grafana server can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster:

{{ include "grafana.fullname" . }}.{{ include "grafana.namespace" . }}.svc.cluster.local
{{ if .Values.ingress.enabled }}
If you bind grafana to 80, please update values in values.yaml and reinstall:
```
securityContext:
runAsUser: 0
runAsGroup: 0
fsGroup: 0

command:
- "setcap"
- "'cap_net_bind_service=+ep'"
- "/usr/sbin/grafana-server &&"
- "sh"
- "/run.sh"
```
Details refer to https://grafana.com/docs/installation/configuration/#http-port.
Or grafana would always crash.

From outside the cluster, the server URL(s) are:
{{- range .Values.ingress.hosts }}
http://{{ . }}
{{- end }}
{{- else }}
Get the Grafana URL to visit by running these commands in the same shell:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ include "grafana.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "grafana.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ include "grafana.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ include "grafana.namespace" . }} -w {{ include "grafana.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ include "grafana.namespace" . }} {{ include "grafana.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
http://$SERVICE_IP:{{ .Values.service.port -}}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ include "grafana.namespace" . }} -l "app.kubernetes.io/name={{ include "grafana.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ include "grafana.namespace" . }} port-forward $POD_NAME 3000
{{- end }}
{{- end }}

3. Login with the password from step 1 and the username: {{ .Values.adminUser }}

{{- if not .Values.persistence.enabled }}
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Grafana pod is terminated. #####
#################################################################################
{{- end }}
Loading

0 comments on commit 9e3c7e7

Please sign in to comment.