Skip to content

Commit

Permalink
overall doc tweak
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Zhu <zzqshu@126.com>
  • Loading branch information
zqzten committed Oct 30, 2023
1 parent b7c55c6 commit b9c2658
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kapacity Website

[![Netlify Status](https://api.netlify.com/api/v1/badges/77afd473-a400-488d-9294-0e36007fc6bf/deploy-status)](https://app.netlify.com/sites/kapacity/deploys)
[![License](https://img.shields.io/github/license/traas-stack/kapacity-website)](https://creativecommons.org/licenses/by/4.0/legalcode.txt)
[![Netlify Status](https://api.netlify.com/api/v1/badges/77afd473-a400-488d-9294-0e36007fc6bf/deploy-status)](https://app.netlify.com/sites/kapacity/deploys)

This repository contains the assets required to build the [Kapacity website and documentation](https://kapacity.netlify.app).
7 changes: 3 additions & 4 deletions content/en/docs/getting-started/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ helm install \
Run following command to view Prometheus Server's ClusterIP and port:

```shell
kubectl get svc -n prometheus
kubectl get svc -n prometheus prometheus-server
```

```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus-kube-state-metrics ClusterIP 10.97.190.94 <none> 8080/TCP 5m
prometheus-server ClusterIP 10.104.214.48 <none> 80/TCP 5m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus-server ClusterIP 10.104.214.48 <none> 80/TCP 5m
```

### Install Kapacity
Expand Down
10 changes: 5 additions & 5 deletions content/en/docs/getting-started/quick-start/ihpa/cron-scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You need to have a Kubernetes cluster with Kapacity installed.

## Run sample workload

Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload.
Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload:

```shell
kubectl apply -f nginx-statefulset.yaml
Expand All @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: cron-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand Down Expand Up @@ -64,10 +68,6 @@ spec:
start: 40 * * * *
end: 50 * * * *
replicas: 5
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

Run following command to create the IHPA:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You need to have a Kubernetes cluster with Kapacity installed.

## Run sample workload

Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload.
Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload:

```shell
kubectl apply -f nginx-statefulset.yaml
Expand All @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: gray-strategy-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -59,10 +63,6 @@ spec:
changeIntervalSeconds: 30 # ChangeIntervalSeconds is the interval time between each gray change.
changePercent: 50 # ChangePercent is the percentage of the total change of replica numbers which is used to calculate the amount of pods to change in each gray change.
observationSeconds: 60 # ObservationSeconds is the additional observation time after the gray change reaching 100%.
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

This IHPA contains below two portrait providers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You need to have a Kubernetes cluster with Kapacity and Prometheus installed.

## Run sample workload

Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload.
Download [nginx-statefulset.yaml](/examples/workload/nginx-statefulset.yaml) and run following command to run an NGINX workload:

```shell
kubectl apply -f nginx-statefulset.yaml
Expand All @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: dynamic-reactive-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -53,10 +57,6 @@ spec:
averageUtilization: 30
algorithm:
type: KubeHPA
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

Run following command to create the IHPA:
Expand All @@ -82,7 +82,7 @@ Start a different pod to act as a client which will send requests to the NGINX s

```shell
# Run this in a separate terminal so that the load generation continues and you can carry on with the rest of the steps
kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://<service-ip>:<service-port>; done"
kubectl run -i --tty load-generator --rm --image=busybox --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://<service-ip>:<service-port> > /dev/null; done"
```

After several minutes, you can see that the workload is scaled up by checking events of the IHPA:
Expand Down
7 changes: 3 additions & 4 deletions content/zh-cn/docs/getting-started/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ helm install \
可以使用如下命令查看 Prometheus Server 的 ClusterIP 和端口:

```shell
kubectl get svc -n prometheus
kubectl get svc -n prometheus prometheus-server
```

```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus-kube-state-metrics ClusterIP 10.97.190.94 <none> 8080/TCP 5m
prometheus-server ClusterIP 10.104.214.48 <none> 80/TCP 5m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus-server ClusterIP 10.104.214.48 <none> 80/TCP 5m
```

### 安装 Kapacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: cron-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand Down Expand Up @@ -64,10 +68,6 @@ spec:
start: 40 * * * *
end: 50 * * * *
replicas: 5
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

执行以下命令创建该 IHPA:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: gray-strategy-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -59,10 +63,6 @@ spec:
changeIntervalSeconds: 30 # ChangeIntervalSeconds is the interval time between each gray change.
changePercent: 50 # ChangePercent is the percentage of the total change of replica numbers which is used to calculate the amount of pods to change in each gray change.
observationSeconds: 60 # ObservationSeconds is the additional observation time after the gray change reaching 100%.
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

该 IHPA 配置了以下两个画像源:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: dynamic-reactive-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -53,10 +57,6 @@ spec:
averageUtilization: 30
algorithm:
type: KubeHPA
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
```

执行以下命令创建该 IHPA:
Expand All @@ -82,7 +82,7 @@ nginx ClusterIP 10.111.21.74 <none> 80/TCP 13m

```shell
# 在单独的终端中运行它以便负载生成继续,你可以继续执行其余步骤
kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://<service-ip>:<service-port>; done"
kubectl run -i --tty load-generator --rm --image=busybox --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://<service-ip>:<service-port> > /dev/null; done"
```

等待几分钟后,可以通过 IHPA 的事件看到工作负载被扩容了:
Expand Down
8 changes: 4 additions & 4 deletions static/examples/ihpa/cron-portrait-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: cron-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand Down Expand Up @@ -30,7 +34,3 @@ spec:
start: 40 * * * *
end: 50 * * * *
replicas: 5
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
8 changes: 4 additions & 4 deletions static/examples/ihpa/dynamic-reactive-portrait-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: dynamic-reactive-portrait-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -19,7 +23,3 @@ spec:
averageUtilization: 30
algorithm:
type: KubeHPA
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1
8 changes: 4 additions & 4 deletions static/examples/ihpa/gray-strategy-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: IntelligentHorizontalPodAutoscaler
metadata:
name: gray-strategy-sample
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: nginx
minReplicas: 1
maxReplicas: 10
portraitProviders:
Expand All @@ -25,7 +29,3 @@ spec:
changeIntervalSeconds: 30 # ChangeIntervalSeconds is the interval time between each gray change.
changePercent: 50 # ChangePercent is the percentage of the total change of replica numbers which is used to calculate the amount of pods to change in each gray change.
observationSeconds: 60 # ObservationSeconds is the additional observation time after the gray change reaching 100%.
scaleTargetRef:
kind: StatefulSet
name: nginx
apiVersion: apps/v1

0 comments on commit b9c2658

Please sign in to comment.