Skip to content

Commit

Permalink
Merge pull request #16 from lianghao208/installation-doc
Browse files Browse the repository at this point in the history
docs: add installation doc (minikube support)
  • Loading branch information
tangcong authored Dec 12, 2021
2 parents 2b83183 + 2611b32 commit d87f387
Show file tree
Hide file tree
Showing 8 changed files with 515 additions and 225 deletions.
124 changes: 10 additions & 114 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,124 +7,20 @@
- Prerequisites
- Kubernetes version is between 1.14 and 1.20.
- The version of Prometheus Operator is v0.49.0.
- Apply for a cluster from [TKE](https://cloud.tencent.com/product/tke) or install [minikube](https://minikube.sigs.k8s.io/docs/start/).
- Apply for a cluster from [TKE](https://cloud.tencent.com/product/tke) or install [Minikube](https://minikube.sigs.k8s.io/docs/start/).
- Kstone supports deploy in various cloud vendors and bare k8s cluster environments
- In the environments mentioned above, only the corresponding ingress rules need to be configured.
- Requirements:
- Worker >= 4 vCPU 8 GB of Memory.
- For production environment (recommended): Worker >= 4 vCPU 8 GB of Memory.
- For demo environment (minimum): Worker >= 2 vCPU 2 GB of Memory.
- Can access the managed etcd.

## 2 Install minikube (optional)
## 2 Install on TKE

#### Step 1:
[Kstone installation on TKE](../docs/installation/tke.md)

- Install minikube (e.g. Linux amd64)
- Requirements:version <= 1.20.x
```shell
VERSION=v1.20.0
curl -LO https://storage.googleapis.com/minikube/releases/${VERSION}/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
```
## 3 Install on Minikube

#### Step 2:
[Kstone installation on Minikube(Mac OS X)](../docs/installation/minikube-macos.md)

- Alias `minikube kubectl`
```shell
alias kubectl="minikube kubectl --"
```

## 3 Deploy

### 3.1 Modify Helm Configuration

#### Step 1:

- Download Helm Repo:

``` shell
git clone git@github.com:tkestack/kstone.git
cd ./charts
```

- Modify Setting:

``` yaml
// charts/values.yaml

ingress:
enabled: true
className: ""
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
service.cloud.tencent.com/direct-access: 'false'
kubernetes.io/ingress.class: qcloud
service.kubernetes.io/tke-existed-lbid: $lb
kubernetes.io/ingress.existLbId: $lb
kubernetes.io/ingress.subnetId: $subnet
```
Method 1: Use existing LB
Refer to the above configuration and fill in the $lb and $subnet under the same VPC of the TKE cluster.
Method 2: Do not use existing LB
Delete the following configurations:
- ingress.annotations.service.kubernetes.io/tke-existed-lbid
- kubernetes.io/ingress.existLbId
- kubernetes.io/ingress.subnetId
#### Step 2:
- Fill in the TOKEN of the cluster to deploy.
``` yaml
// charts/charts/dashboard-api/values.yaml

kube:
token: $token
target: kubernetes.default.svc.cluster.local:443
```
- Requirements:
- $token is the access credential TOKEN of the TKE cluster to be deployed.
- $token needs to have access to all resources in the cluster.
#### Step 3: Using the existing Prometheus Operator (optional)
- Set `replica=0` in the file `charts/charts/kube-prometheus-stack/values.yaml`.
- Modify the file: `charts/charts/grafana/templates/configmap.yaml`, replace `http://{{ .Release.Name }}-prometheus-prometheus.{{ .Release.Namespace }}.svc.cluster.local:9090` to the query URL from the existing Prometheus Operator.

### 3.2 Install

``` shell
cd charts
kubectl create ns kstone
helm install kstone . -n kstone
```

### 3.3 Update

``` shell
cd charts
helm upgrade kstone . -n kstone
```

### 3.4 Uninstall

``` shell
helm uninstall kstone -n kstone
kubectl delete crd alertmanagerconfigs.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
kubectl delete crd podmonitors.monitoring.coreos.com
kubectl delete crd probes.monitoring.coreos.com
kubectl delete crd prometheuses.monitoring.coreos.com
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd thanosrulers.monitoring.coreos.com
kubectl delete crd etcdclusters.kstone.tkestack.io
kubectl delete crd etcdinspections.kstone.tkestack.io
```
[Kstone installation on Minikube(Linux amd64)](../docs/installation/minikube-amd64.md)
120 changes: 9 additions & 111 deletions charts/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,121 +8,19 @@
- Kubernetes集群版本在1.14和1.20之间。
- Prometheus-Operator版本为v0.49.0。
- 申请 [TKE](https://cloud.tencent.com/product/tke) 集群或搭建 [minikube](https://minikube.sigs.k8s.io/docs/start/) 集群。
- Kstone 支持部署在多云或原生 K8s 集群中
- 只需要安装并配置相对应的 Ingress 转发规则即可
- 环境要求:
- Worker 4C8G以上配置。
- 生产环境配置要求(推荐):Worker 4C8G以上配置。
- 体验环境配置要求(最低):Worker 2C2G以上配置。
- 可访问待管理的目标etcd。

## 2 搭建 minikube 集群(可选)
## 2 在 TKE 集群安装 Kstone

#### 步骤一:
- 安装 minikube(以 Linux amd64 为例)
- 版本要求:低于 1.20.x
```shell
VERSION=v1.20.0
curl -LO https://storage.googleapis.com/minikube/releases/${VERSION}/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
```
[Kstone installation on TKE](../docs/installation/tke.md)

#### 步骤二:
-`minikube kubectl` 命令设置别名
```shell
alias kubectl="minikube kubectl --"
```
## 3 在 Minikube 集群安装 Kstone

## 3 部署
[Kstone installation on Minikube(Mac OS X)](../docs/installation/minikube-macos.md)

### 3.1 修改Helm配置

#### 步骤一:

- 下载Helm Repo:

``` shell
git clone git@github.com:tkestack/kstone.git
cd ./charts
```

- 修改配置:

``` yaml
// charts/values.yaml

ingress:
enabled: true
className: ""
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
service.cloud.tencent.com/direct-access: 'false'
kubernetes.io/ingress.class: qcloud
service.kubernetes.io/tke-existed-lbid: $lb
kubernetes.io/ingress.existLbId: $lb
kubernetes.io/ingress.subnetId: $subnet
```
方式一 使用现有LB
参考上述配置,填入TKE集群同VPC下的$lb和$subnet。
方式二 不使用现有LB
删除以下配置:
- ingress.annotations.service.kubernetes.io/tke-existed-lbid
- kubernetes.io/ingress.existLbId
- kubernetes.io/ingress.subnetId
#### 步骤二:
- 填入运行集群的TOKEN。
``` yaml
// charts/charts/dashboard-api/values.yaml

kube:
token: $token
target: kubernetes.default.svc.cluster.local:443
```
- 要求:
- $token为即将部署的TKE集群的访问凭证TOKEN。
- $token需要具备访问集群范围所有资源的权限。
#### 第三步:使用已部署的Prometheus Operator(可选)
- 将文件`charts/charts/kube-prometheus-stack/values.yaml`中的副本数`replica`配置为0。
- 使用已部署的Prometheus Operator提供的查询URL替换文件`charts/charts/grafana/templates/configmap.yaml`中的`http://{{ .Release.Name }}-prometheus-prometheus.{{ .Release.Namespace }}.svc.cluster.local:9090`

### 3.2 安装

``` shell
cd charts
kubectl create ns kstone
helm install kstone . -n kstone
```

### 3.3 更新

``` shell
cd charts
helm upgrade kstone . -n kstone
```

### 3.4 卸载

``` shell
helm uninstall kstone -n kstone
kubectl delete crd alertmanagerconfigs.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
kubectl delete crd podmonitors.monitoring.coreos.com
kubectl delete crd probes.monitoring.coreos.com
kubectl delete crd prometheuses.monitoring.coreos.com
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd thanosrulers.monitoring.coreos.com
kubectl delete crd etcdclusters.kstone.tkestack.io
kubectl delete crd etcdinspections.kstone.tkestack.io
```
[Kstone installation on Minikube(Linux amd64)](../docs/installation/minikube-amd64.md)
Binary file added docs/images/kstone-etcd-cluster-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/kstone-etcd-cluster-running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/kstone-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d87f387

Please sign in to comment.