Skip to content

Commit

Permalink
update doc for archery chart (#43)
Browse files Browse the repository at this point in the history
* update doc for archery chart

* upgrade ct

* update bitnami index

* update bitnami chart url

* fix lint
  • Loading branch information
LeoQuote authored Jan 17, 2023
1 parent 1802356 commit 066b5b9
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
version: v3.10.0

- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: "3.9"

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
uses: helm/chart-testing-action@v2.3.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
8 changes: 4 additions & 4 deletions charts/archery/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 15.7.6
- name: mysql
repository: https://charts.bitnami.com/bitnami
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 8.8.35
- name: goinception
repository: https://douban.github.io/charts/
version: 0.2.0
digest: sha256:adeb44ef7377f8ef5f8aea86bb0d7189e98debfb5cf6254cce02558519389056
generated: "2022-06-16T14:13:22.9483234+08:00"
digest: sha256:edadfb3265b2643adc241b91f26f90c06d2b39797dbde6efb98e689cc1731cda
generated: "2023-01-17T17:36:33.3549974+08:00"
7 changes: 3 additions & 4 deletions charts/archery/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apiVersion: v2
appVersion: "1.0"
home: https://archerydms.com/
description: Archery Helm chart for Kubernetes
name: archery
version: 0.2.4
version: 0.3.0
sources:
- https://github.com/hhyo/Archery

Expand All @@ -14,11 +13,11 @@ maintainers:
dependencies:
- name: redis
version: ~15.7.1
repository: https://charts.bitnami.com/bitnami
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
condition: redis.embedded
- name: mysql
version: ~8.8.20
repository: https://charts.bitnami.com/bitnami
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
condition: mysql.embedded
- name: goinception
version: ~0.2.0
Expand Down
87 changes: 67 additions & 20 deletions charts/archery/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,80 @@
# Archery Kubernetes Helm 部署文档

helm repo add douban
## 最低版本要求

## 2. 替换mysql、redis、archery登录密码
* Kubernetes 1.16+
* Helm 3+

### 2.1 mysql
执行以下命令,执行前将${your mysql password}替换为想要设置的mysql密码。
`grep -rn "MYSQL_ROOT_PASSWORD" *|awk -F: '{print $1}'|uniq|xargs sed -i s/MYSQL_ROOT_PASSWORD/${your mysql password}/g`
## 新增 douban repo
```
helm repo add douban https://douban.github.io/charts/
helm repo update
```

### 2.2 redis
执行以下命令,执行前将${your redis password}替换为想要设置的redis密码。
`grep -rn "REDIS_PASSWORD" *|awk -F: '{print $1}'|uniq|xargs sed -i s/REDIS_PASSWORD/${your redis password}/g`
## 安装 helm chart
```
helm install [RELEASE_NAME] douban/archery
```

### 2.3 archery默认admin登录密码
执行以下命令,执行前将${your archery password}替换为想要设置的archery密码。
`grep -rn "ARCHERY_ADMIN_PASSWORD" *|awk -F: '{print $1}'|uniq|xargs sed -i s/ARCHERY_ADMIN_PASSWORD/${your archery password}/g`
参考下方的 [配置详解](#配置详解)

## 3. 更改mysql持久化配置
## 删除 helm chart
```
helm uninstall [RELEASE_NAME]
```

mysql的存储持久化,请查看values.yaml的方法进行配置。
## 升级 helm chart
helm chart 中, 只有 yaml 的相关修改, 升级时一般不会有 breaking change, 可以直接升级

## 4. LDAP设置
但要注意如果升级了镜像版本, 请参照 archery 的 release note 进行升级操作, 如改表, 更改配置等.

如需启用LDAP,修改value.yaml里comfigmap下settings.py 内相关内容。

## 5. 访问方式
## 配置详解
此处的配置详解只会介绍重点配置, 全部配置请直接看 values.yaml , 或者使用 `helm show values douban/archery` 查看values 说明

5.1 本机访问 kubectl port-forward pods/archery-xxxxxx 9123:9123
5.2 集群外访问 将svc配置为nodePort或loadBalance,或开启ingress
### 最小配置
```
image:
tag: v1.9.1 # 指定 archery 版本, archery 版本变动较快, 建议手动指定
ingress:
enabled: true
className: nginx
paths:
- /
servicePort: 9123
默认用户名: admin
密码为2.3中设置的密码
hosts:
- archery.my-domain.com # 指定访问域名, 需提前设置好 nginx ingress
```

## 配置说明
在 helm chart 中有若干层配置, 请按需要设置, 优先级从低到高依次为:
1. archery 依赖的 redis , mysql 组件的配置, 可以在 values.yaml 中的 redis 和 mysql 下进行配置 (默认使用内置的 mysql 和 redis) , 如果需要, 也可以自己制定 redis 或者 mysql 的连接串, 详见 values 文件
2. archery 容器的环境变量, 可以在 envs 下进行配置, 这里的 envs 和 k8s pod env 完全一致, 你可以自定义, 如:
```
envs:
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: archery
key: SECRET_KEY
- name: ENABLE_LDAP
value: "true"
```
3. 容器内自定义的 local_settins.py, 可以在 configmap 下进行配置, 这里的配置会覆盖 archery 容器内的 local_settings.py, 你可以自定义, 如:
```
configMap:
enabled: true
# admin password
superuser:
username: admin
password: archery # 请尽快修改
email: "archery@example.com"
data:
local_settings.py: |-
# -*- coding: UTF-8 -*-
# 重新设置某些配置
SECRET_KEY = "my-secret-key"
```

helm chart 只是提供配置的方法, 你可以根据自己的需求进行配置, 如果配置出现不符合预期的, 首先确认渲染出的 yaml 是否符合预期, 如果 yaml 符合预期, 说明是 archery 的问题, 请前往 archery 项目提交 issue.
7 changes: 6 additions & 1 deletion charts/archery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replicaCount: 1

image:
repository: hhyo/archery
tag: v1.8.5
tag: v1.9.1
pullPolicy: IfNotPresent

nameOverride: ""
Expand Down Expand Up @@ -145,6 +145,7 @@ goinception:
- name: BACKUP_PASSWORD
value: "my-password"
# you can override more options , please see goinception chart readme and values
# https://github.com/douban/charts/blob/master/charts/goinception/values.yaml

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand All @@ -162,6 +163,8 @@ envs: []
# value: xxx

volumeMounts:
# 请慎重更改以下值, 如需更改建议复制粘贴然后按需求增加键值对
# 更改后可能会造成部分其他配置失效
- name: archery-settings
subPath: local_settings.py
mountPath: /opt/archery/local_settings.py
Expand All @@ -187,6 +190,8 @@ tolerations: []
affinity: {}

volumes:
# 请慎重更改以下值, 如需更改建议复制粘贴然后按需求增加键值对
# 更改后可能会造成部分其他配置失效
- name: archery-settings
configMap:
name: archery-config
Expand Down
2 changes: 1 addition & 1 deletion ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ chart-dirs:
chart-repos:
- stable=https://charts.helm.sh/stable/
- douban=https://douban.github.io/charts/
- bitnami=https://charts.bitnami.com/bitnami
- bitnami=https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
helm-extra-args: --timeout 600s

0 comments on commit 066b5b9

Please sign in to comment.