From 22117fe39ba8f2bfe424db7a5df89d5a5e423d8e Mon Sep 17 00:00:00 2001 From: "kangrong.cn" Date: Mon, 26 Aug 2024 15:34:24 +0800 Subject: [PATCH] fix bugs when make docker-build --- Dockerfile | 3 ++- docs/tutorial/podautoscaler/README.md | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b0816b32..7fb7e903 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.21 AS builder +FROM golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH @@ -15,6 +15,7 @@ RUN go mod download COPY cmd/main.go cmd/main.go COPY api/ api/ COPY pkg/controller/ pkg/controller/ +COPY pkg/utils/ pkg/utils/ # Build # the GOARCH has not a default value to allow the binary be built according to the host where the command diff --git a/docs/tutorial/podautoscaler/README.md b/docs/tutorial/podautoscaler/README.md index 848388f9..414f3c84 100644 --- a/docs/tutorial/podautoscaler/README.md +++ b/docs/tutorial/podautoscaler/README.md @@ -7,10 +7,15 @@ adjusts the number of replicas for an Nginx service based on CPU utilization. ## Start 1: Build and Run Local -First, build and install the Custom Resource Definitions (CRDs) for AIBrix: +Go into the root directory: ```shell cd $AIBrix_HOME +``` + +First, build and install the Custom Resource Definitions (CRDs) for AIBrix: + +```shell make manifests && make build && make install ``` @@ -59,6 +64,13 @@ check the deployed manager logs: kubectl get pods -n aibrix-system -o name | grep aibrix-controller-manager | head -n 1 | xargs -I {} kubectl logs {} -n aibrix-system ``` + +Or you can add `-f` to watch manager's logs continuously: + +```shell +kubectl get pods -n aibrix-system -o name | grep aibrix-controller-manager | head -n 1 | xargs -I {} kubectl logs -f {} -n aibrix-system +``` + Expected output (no warnings, no errors): ```log @@ -85,6 +97,8 @@ The AIBrix-pa will automatically create a corresponding Horizontal Pod Autoscale kubectl apply -f config/samples/autoscaling_v1alpha1_demo_nginx.yaml # Create AIBrix-pa kubectl apply -f config/samples/autoscaling_v1alpha1_podautoscaler.yaml + +kubectl apply -f config/samples/autoscaling_v1alpha1_kpa.yaml ``` After applying the configurations, you should see: @@ -154,6 +168,7 @@ To clean up the resources: ```shell # Remove AIBrix resources kubectl delete podautoscalers.autoscaling.aibrix.ai podautoscaler-example +kubectl delete podautoscalers.autoscaling.aibrix.ai podautoscaler-example-kpa make uninstall && make undeploy