Skip to content

Commit

Permalink
Add sample for hpa, bump version (#101)
Browse files Browse the repository at this point in the history
Signed-off-by: shaoyue.chen <[email protected]>
  • Loading branch information
haorenfsa authored Mar 29, 2024
1 parent 04f9c1d commit 5bfd68c
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 40 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ jobs:
run: |
make sit-prepare-images
- name: Setup KinD Cluster
uses: engineerd/setup-kind@v0.5.0
uses: container-tools/kind-action@v1
with:
version: "v0.11.1"
version: "v0.18.0"
kubectl_version: "v1.24.0"
- name: Deploy to KinD
run: |
make sit-deploy
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
IMG ?= milvusdb/milvus-operator:dev-latest
TOOL_IMG ?= milvus-config-tool:dev-latest
SIT_IMG ?= milvus-operator:sit
VERSION ?= 0.9.10
VERSION ?= 0.9.11
TOOL_VERSION ?= 0.3.0
MILVUS_HELM_VERSION ?= milvus-4.1.23
MILVUS_HELM_VERSION ?= milvus-4.1.27
RELEASE_IMG ?= milvusdb/milvus-operator:v$(VERSION)
TOOL_RELEASE_IMG ?= milvusdb/milvus-config-tool:v$(TOOL_VERSION)
KIND_CLUSTER ?= kind
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ helm -n milvus-operator upgrade --install --create-namespace milvus-operator mil
Or with kubectl & raw manifests:

```shell
kubectl apply -f https://raw.githubusercontent.com/zilliztech/milvus-operator/v0.9.10/deploy/manifests/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/zilliztech/milvus-operator/v0.9.11/deploy/manifests/deployment.yaml
```

For more infomation Check [Installation Instructions](docs/installation/installation.md)
Expand Down Expand Up @@ -82,13 +82,13 @@ Use helm:
```shell
helm upgrade --install milvus-operator \
-n milvus-operator --create-namespace \
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.10/milvus-operator-0.9.10.tgz
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.11/milvus-operator-0.9.11.tgz
```

Or use kubectl & raw manifests:

```shell
kubectl apply -f https://raw.githubusercontent.com/zilliztech/milvus-operator/v0.9.10/deploy/manifests/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/zilliztech/milvus-operator/v0.9.11/deploy/manifests/deployment.yaml
```


Expand Down
4 changes: 2 additions & 2 deletions charts/milvus-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.10
version: 0.9.11

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.9.10"
appVersion: "0.9.11"

maintainers:
- name: zilliztech
Expand Down
2 changes: 1 addition & 1 deletion charts/milvus-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ image:
# image.pullPolicy -- The image pull policy for the controller.
pullPolicy: IfNotPresent
# image.tag -- The image tag whose default is the chart appVersion.
tag: "v0.9.10"
tag: "v0.9.11"

# installCRDs -- If true, CRD resources will be installed as part of the Helm chart. If enabled, when uninstalling CRD resources will be deleted causing all installed custom resources to be DELETED
installCRDs: true
Expand Down
50 changes: 50 additions & 0 deletions config/samples/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a sample to deploy a standalone milvus in milvus-operator's default configurations.
apiVersion: milvus.io/v1beta1
kind: Milvus
metadata:
name: my-release
spec:
mode: cluster
components:
proxy:
# set replicas to -1 will stop operator from scaling the component
# thus handover the scaling responsibility to HPA
replicas: -1
---
# for more info see: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: my-release-milvus-proxy-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-release-milvus-proxy
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 60
behavior:
scaleUp:
policies:
- type: Pods
value: 1
periodSeconds: 30
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 60
28 changes: 14 additions & 14 deletions deploy/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ metadata:
name: "milvus-operator-checker"
namespace: "milvus-operator"
labels:
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
---
# Source: milvus-operator/templates/serviceaccount.yaml
Expand All @@ -24,10 +24,10 @@ metadata:
name: "milvus-operator"
namespace: "milvus-operator"
labels:
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
---
# Source: milvus-operator/templates/crds.yaml
Expand Down Expand Up @@ -14464,10 +14464,10 @@ kind: Service
metadata:
labels:
service-kind: metrics
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
name: 'milvus-operator-metrics-service'
namespace: "milvus-operator"
Expand All @@ -14485,10 +14485,10 @@ apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
name: 'milvus-operator-webhook-service'
namespace: "milvus-operator"
Expand All @@ -14507,10 +14507,10 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
name: "milvus-operator"
namespace: "milvus-operator"
Expand Down Expand Up @@ -14540,7 +14540,7 @@ spec:
- --leader-elect
command:
- /manager
image: 'milvusdb/milvus-operator:v0.9.10'
image: 'milvusdb/milvus-operator:v0.9.11'
imagePullPolicy: "IfNotPresent"
livenessProbe:
httpGet:
Expand Down Expand Up @@ -14597,10 +14597,10 @@ metadata:
annotations:
{}
labels:
helm.sh/chart: milvus-operator-0.9.10
helm.sh/chart: milvus-operator-0.9.11
app.kubernetes.io/name: milvus-operator
app.kubernetes.io/instance: milvus-operator
app.kubernetes.io/version: "0.9.10"
app.kubernetes.io/version: "0.9.11"
app.kubernetes.io/managed-by: Helm
name: "milvus-operator-checker"
namespace: "milvus-operator"
Expand All @@ -14614,7 +14614,7 @@ spec:
restartPolicy: OnFailure
containers:
- name: checker
image: 'milvusdb/milvus-operator:v0.9.10'
image: 'milvusdb/milvus-operator:v0.9.11'
imagePullPolicy: "IfNotPresent"
command: ["/checker"]
args:
Expand Down
10 changes: 5 additions & 5 deletions docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ For quick start, install with one line command:
```shell
helm install milvus-operator \
-n milvus-operator --create-namespace \
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.10/milvus-operator-0.9.10.tgz
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.11/milvus-operator-0.9.11.tgz
```

If you already have `cert-manager` v1.0+ installed which is not in its default configuration, you may encounter some error with the check of cert-manager installation. you can install with special options to disable the check:

```
helm install milvus-operator \
-n milvus-operator --create-namespace \
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.10/milvus-operator-0.9.10.tgz \
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.11/milvus-operator-0.9.11.tgz \
--set checker.disableCertManagerCheck=true
```

Expand All @@ -39,7 +39,7 @@ use helm commands to upgrade earlier milvus-operator to current version:

```shell
helm upgrade -n milvus-operator milvus-operator --reuse-values \
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.10/milvus-operator-0.9.10.tgz
https://github.com/zilliztech/milvus-operator/releases/download/v0.9.11/milvus-operator-0.9.11.tgz
```

## Delete operator
Expand All @@ -62,7 +62,7 @@ If you don't want to use helm you can also install with kubectl and raw manifest
## Installation
It is recommended to install the milvus operator with a newest stable version
```shell
kubectl apply -f https://github.com/zilliztech/milvus-operator/v0.9.10/deploy/manifests/deployment.yaml
kubectl apply -f https://github.com/zilliztech/milvus-operator/v0.9.11/deploy/manifests/deployment.yaml
```

Check the installed operators:
Expand All @@ -85,7 +85,7 @@ Same as installation, you can update the milvus operator with a newer version by
Delete the milvus operator stack by the deployment manifest:

```shell
kubectl delete -f https://github.com/zilliztech/milvus-operator/v0.9.10/deploy/manifests/deployment.yaml
kubectl delete -f https://github.com/zilliztech/milvus-operator/v0.9.11/deploy/manifests/deployment.yaml
```

Or delete the milvus operator stack by using makefile:
Expand Down
50 changes: 39 additions & 11 deletions test/min-mc-feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
proxy:
ingress:
hosts: ["mc-sit.milvus.io"]
replicas: -1
mixCoord:
replicas: 1
dependencies:
Expand Down Expand Up @@ -48,17 +49,44 @@ spec:
persistence:
size: 20Gi
config:
rootCoord:
enableActiveStandby: true
dataCoord:
enableActiveStandby: true
queryCoord:
enableActiveStandby: true
indexCoord:
enableActiveStandby: true
milvus:
log:
level: info
component:
proxy:
timeTickInterval: 150
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: milvus-milvus-proxy-hpa
namespace: mc-sit
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: milvus-milvus-proxy
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 60
behavior:
scaleUp:
policies:
- type: Pods
value: 1
periodSeconds: 30
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 60

0 comments on commit 5bfd68c

Please sign in to comment.