diff --git a/go.mod b/go.mod index b343cc5d5..2deb20d0f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/evanphx/json-patch v4.11.0+incompatible github.com/go-echarts/go-echarts/v2 v2.2.4 - github.com/gocrane/api v0.10.0 + github.com/gocrane/api v0.11.0 github.com/google/cadvisor v0.39.2 github.com/jaypipes/ghw v0.9.0 github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 diff --git a/go.sum b/go.sum index 3454d2863..59d862dcc 100644 --- a/go.sum +++ b/go.sum @@ -348,8 +348,8 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.1.0-rc.5 h1:QOAag7FoBaBYYHRqzqkhhd8fq5RTubvI4v3Ft/gDVVQ= github.com/gobwas/ws v1.1.0-rc.5/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= -github.com/gocrane/api v0.10.0 h1:qzYFg9I2NNuvkZ7PZKCOmz4oEnRa+hvl68rEW12ZGdI= -github.com/gocrane/api v0.10.0/go.mod h1:GxI+t9AW8+NsHkz2JkPBIJN//9eLUjTZl1ScYAbXMbk= +github.com/gocrane/api v0.11.0 h1:cS7653Q/V2StBeQJzIxF2oqz/9iDktfiX6qYVSMCWMg= +github.com/gocrane/api v0.11.0/go.mod h1:GxI+t9AW8+NsHkz2JkPBIJN//9eLUjTZl1ScYAbXMbk= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/site/content/en/docs/Getting started/Installation/installation.md b/site/content/en/docs/Getting started/Installation/installation.md index e5161b16b..6fe664738 100644 --- a/site/content/en/docs/Getting started/Installation/installation.md +++ b/site/content/en/docs/Getting started/Installation/installation.md @@ -9,6 +9,10 @@ weight: 11 - Kubernetes 1.18+ - Helm 3.1.0 +{{% alert color="warning" %}} +If your Kubernetes version >= 1.26, please referring to [PR](https://github.com/gocrane/crane/pull/839) +{{% /alert %}} + ## Steps ### Helm Installation diff --git a/site/content/en/docs/Getting started/Installation/quick-start.md b/site/content/en/docs/Getting started/Installation/quick-start.md index b831a4e57..a13295961 100644 --- a/site/content/en/docs/Getting started/Installation/quick-start.md +++ b/site/content/en/docs/Getting started/Installation/quick-start.md @@ -21,6 +21,10 @@ Please referring to [Installation](/docs/getting-started/installation/installati - Helm 3.1.0 - Kind 0.16+ +{{% alert color="warning" %}} +If your Kubernetes version >= 1.26, please referring to [PR](https://github.com/gocrane/crane/pull/839) +{{% /alert %}} + ## Installation Following command will install Crane with dependencies applications(Prometheus/Grafana). diff --git a/site/content/en/docs/Tutorials/Recommendation/recommendation-framework.md b/site/content/en/docs/Tutorials/Recommendation/recommendation-framework.md index ed6203bd2..7ccec3f43 100644 --- a/site/content/en/docs/Tutorials/Recommendation/recommendation-framework.md +++ b/site/content/en/docs/Tutorials/Recommendation/recommendation-framework.md @@ -57,44 +57,22 @@ kubectl apply -f workload-rules.yaml This example will analysis Resource and Replicas for Deployments and StatefulSets in all namespace.。 -2. Check the RecommendationRule recommendation progress. Observe the progress of recommendation tasks through `Status.recommendations`. Recommendation tasks are executed sequentially. If lastStartTime of all tasks is the latest time and message has value, it indicates that this recommendation is completed. +2. Check the RecommendationRule recommendation progress. Through the annotations of the Recommendation, the start time of the last run of the job and the results can be observed. ```shell -kubectl get rr workloads-rule +kubectl get recommend workloads-rule-replicas-7djlk -o yaml ``` ```yaml -status: - lastUpdateTime: "2022-09-28T10:36:02Z" - recommendations: - - apiVersion: analysis.crane.io/v1alpha1 - kind: Recommendation - lastStartTime: "2022-09-28T10:36:02Z" - message: Success - name: workloads-rule-replicas-rckvb - namespace: default - recommenderRef: - name: Replicas - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: php-apache - namespace: default - uid: b15cbcd7-6fe2-4ace-9ae8-11cc0a6e69c2 - - apiVersion: analysis.crane.io/v1alpha1 - kind: Recommendation - lastStartTime: "2022-09-28T10:36:02Z" - message: Success - name: workloads-rule-resource-pnnxn - namespace: default - recommenderRef: - name: Resource - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: php-apache - namespace: default - uid: 8472013a-bda2-4025-b0df-3fdc69c1c910 +apiVersion: analysis.crane.io/v1alpha1 +kind: Recommendation +metadata: + annotations: + analysis.crane.io/last-start-time: "2023-07-24 11:43:58" + analysis.crane.io/message: 'Failed to run recommendation flow in recommender Replicas: + Replicas CalculatePodTemplateRequests cpu failed: missing request for cpu' + analysis.crane.io/run-number: "59" + creationTimestamp: "2023-06-01T11:37:16Z" ``` 3. Check `Recommendation` diff --git a/site/content/zh/docs/Getting started/Installation/installation.md b/site/content/zh/docs/Getting started/Installation/installation.md index 8c43456f8..5ff486aec 100644 --- a/site/content/zh/docs/Getting started/Installation/installation.md +++ b/site/content/zh/docs/Getting started/Installation/installation.md @@ -19,6 +19,10 @@ Crane 安装时间在10分钟左右,具体时间也依赖集群规模以及硬 - Kubernetes 1.18+ - Helm 3.1.0 +{{% alert color="warning" %}} +如果你的 Kubernetes 版本 >= 1.26, 请参考 [PR](https://github.com/gocrane/crane/pull/839) +{{% /alert %}} + ## 安装流程 ### 安装 Helm diff --git a/site/content/zh/docs/Getting started/Installation/quick-start.md b/site/content/zh/docs/Getting started/Installation/quick-start.md index 67512ac5b..abe7b7960 100644 --- a/site/content/zh/docs/Getting started/Installation/quick-start.md +++ b/site/content/zh/docs/Getting started/Installation/quick-start.md @@ -20,6 +20,10 @@ weight: 10 - Helm 3.1.0 - Kind 0.16+ +{{% alert color="warning" %}} +如果你的 Kubernetes 版本 >= 1.26, 请参考 [PR](https://github.com/gocrane/crane/pull/839) +{{% /alert %}} + ## 安装 以下命令将安装 Crane 以及其依赖 (Prometheus/Grafana). diff --git a/site/content/zh/docs/Tutorials/Recommendation/recommendation-framework.md b/site/content/zh/docs/Tutorials/Recommendation/recommendation-framework.md index 312f8f671..c21d88b7f 100644 --- a/site/content/zh/docs/Tutorials/Recommendation/recommendation-framework.md +++ b/site/content/zh/docs/Tutorials/Recommendation/recommendation-framework.md @@ -57,44 +57,22 @@ kubectl apply -f workload-rules.yaml 这个例子会对所有 namespace 中的 Deployments 和 StatefulSets 做资源推荐和副本数推荐。 -2. 检查 RecommendationRule 的推荐进度。通过 Status.recommendations 观察推荐任务的进度,推荐任务是顺序执行,如果所有任务的 lastStartTime 为最近时间且 message 有值,则表示这一次推荐完成 +2. 检查 RecommendationRule 的推荐进度。通过 Recommendation 的 Annotation 可观察到任务的上次开始时间和运行的结果。 ```shell -kubectl get rr workloads-rule +kubectl get recommend workloads-rule-replicas-7djlk -o yaml ``` ```yaml -status: - lastUpdateTime: "2022-09-28T10:36:02Z" - recommendations: - - apiVersion: analysis.crane.io/v1alpha1 - kind: Recommendation - lastStartTime: "2022-09-28T10:36:02Z" - message: Success - name: workloads-rule-replicas-rckvb - namespace: default - recommenderRef: - name: Replicas - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: php-apache - namespace: default - uid: b15cbcd7-6fe2-4ace-9ae8-11cc0a6e69c2 - - apiVersion: analysis.crane.io/v1alpha1 - kind: Recommendation - lastStartTime: "2022-09-28T10:36:02Z" - message: Success - name: workloads-rule-resource-pnnxn - namespace: default - recommenderRef: - name: Resource - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: php-apache - namespace: default - uid: 8472013a-bda2-4025-b0df-3fdc69c1c910 +apiVersion: analysis.crane.io/v1alpha1 +kind: Recommendation +metadata: + annotations: + analysis.crane.io/last-start-time: "2023-07-24 11:43:58" + analysis.crane.io/message: 'Failed to run recommendation flow in recommender Replicas: + Replicas CalculatePodTemplateRequests cpu failed: missing request for cpu' + analysis.crane.io/run-number: "59" + creationTimestamp: "2023-06-01T11:37:16Z" ``` 3. 查看优化建议 `Recommendation`