move helm chart deployment process doc

This commit is contained in:
c9s 2021-12-28 00:09:48 +08:00
parent 5e8c1775be
commit e1c0296705
3 changed files with 84 additions and 73 deletions

View File

@ -481,79 +481,6 @@ streambook.BindStream(stream)
(TBD)
## Helm Chart
If you need redis:
```sh
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install redis bitnami/redis
```
To get the dynamically generated redis password, you can use the following command:
```sh
export REDIS_PASSWORD=$(kubectl get secret --namespace bbgo redis -o jsonpath="{.data.redis-password}" | base64 --decode)
```
Prepare your docker image locally (you can also use the docker image from docker hub):
```sh
make docker DOCKER_TAG=1.16.0
```
The docker tag version number is from the file [Chart.yaml](charts/bbgo/Chart.yaml)
Choose your instance name:
```sh
export INSTANCE=grid
```
Prepare your secret:
```sh
kubectl create secret generic bbgo-$INSTANCE --from-env-file .env.local
```
Configure your config file, the chart defaults to read config/bbgo.yaml to create a configmap:
```sh
cp config/grid.yaml bbgo-$INSTANCE.yaml
vim bbgo-$INSTANCE.yaml
```
Prepare your configmap:
```sh
kubectl create configmap bbgo-$INSTANCE --from-file=bbgo.yaml=bbgo-$INSTANCE.yaml
```
Install chart with the preferred release name, the release name maps to the previous secret we just created, that
is, `bbgo-grid`:
```sh
helm install --set existingConfigmap=bbgo-$INSTANCE bbgo-$INSTANCE ./charts/bbgo
```
To use the latest version:
```sh
helm install --set existingConfigmap=bbgo-$INSTANCE --set image.tag=latest bbgo-$INSTANCE ./charts/bbgo
```
To upgrade:
```sh
helm upgrade bbgo-$INSTANCE ./charts/bbgo
helm upgrade --set image.tag=1.15.2 bbgo-$INSTANCE ./charts/bbgo
```
Delete chart:
```sh
helm delete bbgo-$INSTANCE
```
## Development

View File

@ -16,12 +16,15 @@ nameOverride: ""
fullnameOverride: ""
# existingConfigMap is used for loading the existing configmap
# optional, if you have a configmap rather than the default configmap name
existingConfigMap:
# configmap could be a string pointing to the local file in the chart
# or a object with inlined bbgo yaml config
configmap:
# dotenv defines environment variables, which are loaded from a k8s secret.
# if not defined, then release name will be used to load the secret.
dotenv:
secret: null

View File

@ -0,0 +1,81 @@
## Helm Chart
If you need redis:
```sh
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install redis bitnami/redis
```
To get the dynamically generated redis password, you can use the following command:
```sh
export REDIS_PASSWORD=$(kubectl get secret --namespace bbgo redis -o jsonpath="{.data.redis-password}" | base64 --decode)
```
Prepare your docker image locally (you can also use the docker image from docker hub):
```sh
make docker DOCKER_TAG=1.16.0
```
The docker tag version number is from the file [Chart.yaml](charts/bbgo/Chart.yaml)
Choose your instance name:
```sh
export INSTANCE=grid
```
Prepare your secret:
```sh
kubectl create secret generic bbgo-$INSTANCE --from-env-file .env.local
```
Configure your config file, the chart defaults to read config/bbgo.yaml to create a configmap:
```sh
cp config/grid.yaml bbgo-$INSTANCE.yaml
vim bbgo-$INSTANCE.yaml
```
Prepare your configmap:
```sh
kubectl create configmap bbgo-$INSTANCE --from-file=bbgo.yaml=bbgo-$INSTANCE.yaml
```
Install chart with the preferred release name, the release name maps to the previous secret we just created, that
is, `bbgo-grid`:
```sh
helm install bbgo-$INSTANCE ./charts/bbgo
```
By default, the helm chart uses configmap and dotenv secret by the release name,
if you have an existing configmap that is not named `bbgo-$INSTANCE`, you can specify the configmap via
the `existingConfigmap` option:
```sh
helm install --set existingConfigmap=bbgo-$INSTANCE bbgo-$INSTANCE ./charts/bbgo
```
To use the latest version:
```sh
helm install --set existingConfigmap=bbgo-$INSTANCE --set image.tag=latest bbgo-$INSTANCE ./charts/bbgo
```
To upgrade:
```sh
helm upgrade bbgo-$INSTANCE ./charts/bbgo
helm upgrade --set image.tag=1.15.2 bbgo-$INSTANCE ./charts/bbgo
```
Delete chart:
```sh
helm delete bbgo-$INSTANCE
```