Skip to content

Commit

Permalink
chore: update helm install
Browse files Browse the repository at this point in the history
  • Loading branch information
evelynwei committed Dec 5, 2024
1 parent b8249a0 commit 0ffdba2
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 3 deletions.
65 changes: 65 additions & 0 deletions deploy/README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Polaris Controller helm安装文档

简体中文 | [English](./README.md)

本文档介绍如何使用 helm chart 安装 polaris-controller 服务。

## 准备工作

确保已经安装 k8s 集群,且安装了 helm。
在polaris-system命名空间下已经成功部署polaris server服务
(参考文档见: [helm部署北极星](https://github.com/polarismesh/polaris/tree/main/release/cluster/helm))

## 安装
### 初始化helm配置
确认`deploy/variables.txt`文件中的变量赋值符合预期,示例如下
```shell
cd deploy
$ cat variables.txt deploy -> main ? ! |
POLARIS_HOST:polaris.polaris-system
CONTROLLER_VERSION:v1.7.1
SIDECAR_VERSION:v1.5.1
POLARIS_TOKEN:nu/0WRA4EqSR1FagrjRj0fZwPXuGlMpX+zCuWu4uMqy8xr1vRjisSbA25aAC3mtU8MeeRsKhQiDAynUR09I=
ENVOY_VERSION:v1.26.2
CLUSTER_NAME:default
JAVA_AGENT_INIT:v0.0.1%
```
初始化helm项目的`values.yaml`文件
```shell
sh init_helm.sh
```

### 部署
使用`helm install ${release_name} .`命令安装,将 `${release_name}` 替换为您需要的 release 名。示例如下
```shell
cd helm
helm install polaris-controller .
```

### 更新
使用`helm upgrade -i ${release_name} .`命令更新,将 `${release_name}` 替换为您需要的 release 名。示例如下
```shell
helm upgrade -i polaris-controller .
```

### 卸载
使用`helm uninstall `${release_name}``命令更新,将 `${release_name}` 替换为您需要的 release 名。示例如下
```shell
$ helm uninstall polaris-controller
```

## 配置
支持的配置可查看helm项目的`values.yaml`文件













53 changes: 53 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Polaris Controller helm

English | [简体中文](./README-zh.md)

This page show how to get polaris-controller service started by helm chart。

## Prerequisites
Make sure k8s cluster is installed and helm is installed. And the polaris-server is running in the polaris-system namespaces of k8s.
(Guidance:[polaris installation by using helm](https://github.com/polarismesh/polaris/tree/main/release/cluster/helm))

## Installation
### helm init
Confirm that the variable assignments in the `deploy/variables.txt` file are as expected, the example is as follows
```shell
cd deploy
$ cat variables.txt deploy -> main ? ! |
POLARIS_HOST:polaris.polaris-system
CONTROLLER_VERSION:v1.7.1
SIDECAR_VERSION:v1.5.1
POLARIS_TOKEN:token
ENVOY_VERSION:v1.26.2
CLUSTER_NAME:default
JAVA_AGENT_INIT:v0.0.1%
```
Initialize the `values.yaml` file of the helm project
```shell
sh init_helm.sh
```

### install
Use the `helm install ${release_name}.` command to install, replacing `${release_name}` with the release name you need.
Examples are as follows
```shell
cd helm
helm install polaris-controller .
```

### update
Use the `helm upgrade -i ${release_name} .` command to update and replace `${release_name}` with the release name you need.
Examples are as follows
```shell
helm upgrade -i polaris-controller .
```

### uninstall
Use the `helm uninstall `${release_name}` command to update, replacing `${release_name}` with the release name you need.
Examples are as follows
```shell
$ helm uninstall polaris-controller
```

## Configuration
Configs in `values.yaml` of helm will explain how to configure the service.
27 changes: 27 additions & 0 deletions deploy/init_helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

# preprocess the variables

function replaceVar() {
for file in $(ls */helm/values.yaml); do
key="#$1#"
echo "process replace file $file, key $key, value $2"
if [ "$(uname)" == "Darwin" ]; then
sed -i "" "s?$key?$2?g" $file
else
sed -i "s?$key?$2?g" $file
fi
done
}

varFile="variables.txt"
if [ ! -f "$varFile" ]; then
echo "variables.txt not exists"
exit 1
fi

export -f replaceVar

cat $varFile | awk -F ':' '{print "replaceVar", $1, $2}' | "/bin/bash"
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
memory: {{ .Values.controller.limit.memory }}
volumeMounts:
- mountPath: /polaris-controller/log
name: log
name: logs
- name: certs
mountPath: /etc/polaris-inject/certs
readOnly: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
memory: {{ .Values.controller.limit.memory }}
volumeMounts:
- mountPath: /polaris-controller/log
name: log
name: logs
- name: certs
mountPath: /etc/polaris-inject/certs
readOnly: true
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.6.0-alpha.1
v1.7.2

0 comments on commit 0ffdba2

Please sign in to comment.