Skip to content

Commit

Permalink
add helm package
Browse files Browse the repository at this point in the history
  • Loading branch information
linuzb committed Nov 9, 2023
1 parent 29ae678 commit ce118c1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 工作流名称
name: Build and Push Docker Image
name: Build and Push Docker Image and Helm package

on:
push:
Expand All @@ -10,6 +10,8 @@ env:
GRAFANA_DOCKERHUB_REPO: lunettes/grafana
# Plugins to be installed.
GRAFANA_PLUGINS: yesoreyeram-infinity-datasource marcusolsson-json-datasource volkovlabs-form-panel marcusolsson-dynamictext-panel
REGISTRY: ghcr.io

jobs:
main:
# Run on Ubuntu.
Expand All @@ -33,7 +35,7 @@ jobs:
# DOCKERHUB_TOKEN: docker hub => Account Setting => Security => New Access Token.
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Use the git command to retrieve the current tag information and store it in the environment variable APP_VERSION.
Use the git command to retrieve the current tag information and store it in the environment variable APP_VERSION.
- name: Generate App Version
run: echo APP_VERSION=`git describe --tags --always` >> $GITHUB_ENV
- name: Build and push lunettes
Expand Down Expand Up @@ -64,4 +66,28 @@ jobs:
# Generate two Docker tags: ${APP_VERSION} 和 latest
tags: |
${{ env.GRAFANA_DOCKERHUB_REPO }}:latest
${{ env.GRAFANA_DOCKERHUB_REPO }}:${{ env.APP_VERSION }}
${{ env.GRAFANA_DOCKERHUB_REPO }}:${{ env.APP_VERSION }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
# Publishing and installing a package with GitHub Actions
# see: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions
password: ${{ secrets.GITHUB_TOKEN }}

- uses: azure/setup-helm@v3
id: install

- name: get epository name
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV

- name: helm package chart
run: |
sed -i 's/grafanaImage: lunettes\/grafana:latest/grafanaImage: lunettes\/grafana:${{ env.APP_VERSION }}/g' deploy/helm/lunettes/values.yaml
sed -i 's/lunettesImage: lunettes\/lunettes:latest/lunettesImage: lunettes\/lunettes:${{ env.APP_VERSION }}/g' deploy/helm/lunettes/values.yaml
helm package deploy/helm/lunettes --app-version=${{ env.APP_VERSION }} --version=${{ env.APP_VERSION }} -d _out
- name: helm push chart
run: helm push _out/lunettes-chart-${{ env.APP_VERSION }}.tgz oci://ghcr.io/${{ env.REPOSITORY_NAME }}
8 changes: 4 additions & 4 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Lunettes 可以识别容器生命周期每个交付阶段的开始和结尾,
第二步:通过 Helm 安装 Lunettes
```bash
# Use NodePort
helm install deploy/helm/lunettes \
helm install lunettes oci://ghcr.io/alipay/lunettes-chart \
# enableAuditApiserver 设置为 true 将会开启 apiserver 的审计能力
# 注意: 该过程会重启 apiserver
--set enableAuditApiserver=true
--set grafanaType=NodePort
--set jaegerType=NodePort
--set enableAuditApiserver=true \
--set grafanaType=NodePort \
--set jaegerType=NodePort
```

第三步:获取 Lunettes 服务的接口
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ The following method will expose the service through NodePort. Please make sure
Step2: Install Lunettes with Helm
```bash
# Use NodePort
helm install deploy/helm/lunettes \
helm install lunettes oci://ghcr.io/alipay/lunettes-chart \
# Setting enableAuditApiserver to true will enable the auditing of the apiserver for you.
# Please note that this process will restart the apiserver.
--set enableAuditApiserver=true
--set grafanaType=NodePort
--set jaegerType=NodePort
--set enableAuditApiserver=true \
--set grafanaType=NodePort \
--set jaegerType=NodePort
```

Step3: Find the endpoint of Lunettes dashboard service
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/lunettes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: lunettes
description: A Helm chart for Kubernetes
name: lunettes-chart
description: A Helm chart for Lunettes

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
2 changes: 1 addition & 1 deletion docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kind create cluster \
## Deploy Lunettes with helm

```bash
helm upgrade --install lunettes deploy/helm/lunettes/ \
helm install lunettes oci://ghcr.io/alipay/lunettes-chart \
--set enableAuditApiserver=true \
--set lunettesType=NodePort \
--set grafanadiType=NodePort \
Expand Down

0 comments on commit ce118c1

Please sign in to comment.