From b52353321ed366432a27c3208776b523f7159116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=20=E5=BB=BA=E6=98=8C?= Date: Wed, 17 Aug 2022 16:38:55 +0800 Subject: [PATCH] update helm chart **Phenomenon and reproduction steps** update helm chart **Root cause and solution** **Impactions** **Test method** **Affected branch(es)** * main **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo) --- .github/workflows/release-chart.yml | 66 +++++++++---------- charts/deepflow-agent/Chart.yaml | 2 +- .../deepflow-agent/templates/daemonset.yaml | 2 +- charts/deepflow/Chart.yaml | 2 +- .../clickhouse/templates/statefulset.yaml | 4 +- .../charts/mysql/templates/deployment.yaml | 4 +- charts/deepflow/values.yaml | 20 +++++- 7 files changed, 55 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release-chart.yml b/.github/workflows/release-chart.yml index c6e2b8b..e5d2d6e 100644 --- a/.github/workflows/release-chart.yml +++ b/.github/workflows/release-chart.yml @@ -4,8 +4,8 @@ on: push: branches: - main - # paths: - # - 'charts/**' + paths: + - 'charts/**' workflow_dispatch: inputs: ref: @@ -38,31 +38,10 @@ jobs: with: version: v3.8.1 - # - name: Run chart-releaser - # uses: helm/chart-releaser-action@v1.4.0 - # env: - # CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # ref: 'gh-pages' - - # - name: run - # run: | - # gh repo clone deepflowys/deepflow - # cd deepflow/ - # git checkout -b gh-pages origin/gh-pages - # cp -raf ../index.yaml ./index.yaml - # git config --global user.name "action" - # git config --global user.email "$action@users.noreply.github.com" - # git remote set-url --push origin https://action:${{ secrets.PUSH_SECRET }}@github.com/deepflowys/deepflow - # git add index.yaml - # git commit -am "update charts" - # git push - # env: - # GH_TOKEN: ${{ secrets.PUSH_SECRET }} + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.4.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.6.1 @@ -102,11 +81,9 @@ jobs: - name: add deepflow helm repo run: | - helm repo add deepflow https://deepflowys.github.io/deepflow + helm repo add deepflow https://deepflowys.github.io/deepflow-charts/ helm repo update deepflow - # helm pull deepflow/deepflow - # tar -zxvf deepflow-*.tgz - # helm show chart deepflow/charts/grafana |yq -e |jq -r .appVersion + - name: install deepflow run: | helm upgrade --install deepflow -n deepflow deepflow/deepflow --create-namespace \ @@ -122,8 +99,6 @@ jobs: DEPENDSIMAGE=$(kubectl get pods -n deepflow -o jsonpath={.items[*].spec.containers[*].image}|awk -F" " '{for(i=1;i<=NF;i++) print $i}' |grep -v registry.cn-beijing.aliyuncs.com|sort -u) for SYNCIMAGE in $DEPENDSIMAGE do - #echo "FROM $SYNCIMAGE" > Dockerfile - #cat Dockerfile SORTIMAGE=$(echo $SYNCIMAGE|awk -F/ '{print $NF}') echo $SORTIMAGE echo "skopeo copy -a docker://$SYNCIMAGE docker://deepflowce/$SORTIMAGE" @@ -132,6 +107,25 @@ jobs: skopeo copy -a docker://$SYNCIMAGE docker://deepflowce/$SORTIMAGE skopeo copy -a docker://$SYNCIMAGE docker://registry.cn-beijing.aliyuncs.com/deepflow-ce/$SORTIMAGE skopeo copy -a docker://$SYNCIMAGE docker://ghcr.io/deepflowys/deepflow-ce/$SORTIMAGE - # echo "docker buildx build --platform linux/amd64,linux/arm64 --push -t deepflowce/$SORTIMAGE -t registry.cn-beijing.aliyuncs.com/deepflow-ce/$SORTIMAGE -t ghcr.io/deepflowys/deepflow-ce/$SORTIMAGE -f Dockerfile ." - # docker buildx build --platform linux/amd64,linux/arm64 --push -t deepflowce/$SORTIMAGE -t registry.cn-beijing.aliyuncs.com/deepflow-ce/$SORTIMAGE -t ghcr.io/deepflowys/deepflow-ce/$SORTIMAGE -f Dockerfile . - done \ No newline at end of file + done + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: 'gh-pages' + + - name: run + run: | + gh repo clone deepflowys/deepflow + cd deepflow/ + git checkout -b gh-pages origin/gh-pages + cp -raf ../index.yaml ./index.yaml + git config --global user.name "action" + git config --global user.email "$action@users.noreply.github.com" + git remote set-url --push origin https://action:${{ secrets.PUSH_SECRET }}@github.com/deepflowys/deepflow + git add index.yaml + git commit -am "update charts" + git push + env: + GH_TOKEN: ${{ secrets.PUSH_SECRET }} \ No newline at end of file diff --git a/charts/deepflow-agent/Chart.yaml b/charts/deepflow-agent/Chart.yaml index 02da5ec..2480cbc 100644 --- a/charts/deepflow-agent/Chart.yaml +++ b/charts/deepflow-agent/Chart.yaml @@ -3,7 +3,7 @@ description: An automated observability platform for cloud-native developers. name: deepflow-agent engine: gotpl type: application -version: 0.1.013 +version: 0.1.014 appVersion: "6.1.1" kubeVersion: ">=1.16.0-0" sources: diff --git a/charts/deepflow-agent/templates/daemonset.yaml b/charts/deepflow-agent/templates/daemonset.yaml index 204d8d9..e6e0031 100644 --- a/charts/deepflow-agent/templates/daemonset.yaml +++ b/charts/deepflow-agent/templates/daemonset.yaml @@ -34,7 +34,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag .}}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" imagePullPolicy: {{ tpl .Values.image.pullPolicy . }} ports: - name: receive diff --git a/charts/deepflow/Chart.yaml b/charts/deepflow/Chart.yaml index 6e606ea..125a986 100644 --- a/charts/deepflow/Chart.yaml +++ b/charts/deepflow/Chart.yaml @@ -3,7 +3,7 @@ description: An automated observability platform for cloud-native developers. name: deepflow engine: gotpl type: application -version: 0.1.013 +version: 0.1.014 appVersion: "6.1.1" kubeVersion: ">=1.16.0-0" sources: diff --git a/charts/deepflow/charts/clickhouse/templates/statefulset.yaml b/charts/deepflow/charts/clickhouse/templates/statefulset.yaml index 3a35f1d..f60a643 100644 --- a/charts/deepflow/charts/clickhouse/templates/statefulset.yaml +++ b/charts/deepflow/charts/clickhouse/templates/statefulset.yaml @@ -33,7 +33,7 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} initContainers: - name: clickhouse-init - image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" volumeMounts: - name: clickhouse-path mountPath: /var/lib/clickhouse/ @@ -44,7 +44,7 @@ spec: - name: clickhouse securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" imagePullPolicy: {{ tpl .Values.image.pullPolicy . }} env: - name: TZ diff --git a/charts/deepflow/charts/mysql/templates/deployment.yaml b/charts/deepflow/charts/mysql/templates/deployment.yaml index 7d54d94..b8bbb10 100644 --- a/charts/deepflow/charts/mysql/templates/deployment.yaml +++ b/charts/deepflow/charts/mysql/templates/deployment.yaml @@ -35,7 +35,7 @@ spec: {{- if and (eq ( tpl $.Values.storageConfig.generateType . ) "hostPath") ($.Values.storageConfig.hostPathChownContainerEnabled) }} initContainers: - name: hostpath-chown - image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" securityContext: runAsNonRoot: false runAsUser: 0 @@ -51,7 +51,7 @@ spec: - name: mysql securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" imagePullPolicy: {{ tpl .Values.image.pullPolicy . }} ports: - name: tcp diff --git a/charts/deepflow/values.yaml b/charts/deepflow/values.yaml index 197df24..7b2d308 100644 --- a/charts/deepflow/values.yaml +++ b/charts/deepflow/values.yaml @@ -403,10 +403,11 @@ clickhouse: dnsPolicy: "{{ .Values.global.dnsPolicy }}" podManagementPolicy: "{{ .Values.global.podManagementPolicy }}" image: - repository: clickhouse/clickhouse-server + ## Clickhouse Dockerhub Image repository: clickhouse/clickhouse-server + repository: "{{ .Values.global.image.repository }}/clickhouse-server" pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "21.8.15.7" + tag: 21.8.15.7 timezone: "{{ .Values.global.timezone }}" imagePullSecrets: [] @@ -553,6 +554,13 @@ mysql: timezone: "{{ .Values.global.timezone }}" podAnnotations: {} + image: + ## MySQL Dockerhub Image repository: mysql + repository: "{{ .Values.global.image.repository }}/mysql" + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: 8.0.26 + podSecurityContext: {} # fsGroup: 2000 @@ -763,6 +771,14 @@ grafana: defaultDashboardsTimezone: utc adminPassword: deepflow + image: + ## Grafana aliyun Image repository: registry.cn-beijing.aliyuncs.com/deepflow-ce/grafana + repository: grafana/grafana + # Overrides the Grafana image tag whose default is the chart appVersion + tag: "" + sha: "" + pullPolicy: IfNotPresent + service: enabled: true type: NodePort