-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
203 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Vertical pod autoscaler to Azure disk CSI controller pods | ||
## Prerequisites: install vertical pod autoscaler | ||
You should install Vertical Pod Autoscaler first, please refer to the [vertical-pod-autoscaler](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) | ||
|
||
## Create a VPA corresponding to CSI controller deployment | ||
> create a VPA for CSI controller | ||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/example/vpa/vertical-pod-autoscaler.yaml | ||
``` | ||
> check the VPA config and current recommended resource requests | ||
``` | ||
kubectl get vpa -n kube-system | ||
NAME MODE CPU MEM PROVIDED AGE | ||
csi-azuredisk-controller Auto 15m 43690666 True 8s | ||
kubectl describe vpa csi-azuredisk-controller -n kube-system | ||
Name: csi-azuredisk-controller | ||
Namespace: kube-system | ||
Labels: <none> | ||
Annotations: <none> | ||
API Version: autoscaling.k8s.io/v1 | ||
Kind: VerticalPodAutoscaler | ||
Metadata: | ||
Creation Timestamp: 2024-09-25T02:54:36Z | ||
Generation: 1 | ||
Resource Version: 417864 | ||
UID: 6c393ae3-2f17-4efe-974c-2f0d1f4c635a | ||
Spec: | ||
Resource Policy: | ||
Container Policies: | ||
Container Name: * | ||
Max Allowed: | ||
Cpu: 15m | ||
Memory: 50Gi | ||
Target Ref: | ||
API Version: apps/v1 | ||
Kind: Deployment | ||
Name: csi-azuredisk-controller | ||
Update Policy: | ||
Update Mode: Auto | ||
Status: | ||
Conditions: | ||
Last Transition Time: 2024-09-25T02:55:13Z | ||
Status: True | ||
Type: RecommendationProvided | ||
Recommendation: | ||
Container Recommendations: | ||
Container Name: azuredisk | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 15m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 23m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 55999064 | ||
Container Name: csi-attacher | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 86115636 | ||
Container Name: csi-provisioner | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 55999064 | ||
Container Name: csi-resizer | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 55999064 | ||
Container Name: csi-snapshotter | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 55999064 | ||
Container Name: liveness-probe | ||
Lower Bound: | ||
Cpu: 10m | ||
Memory: 43690666 | ||
Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Uncapped Target: | ||
Cpu: 11m | ||
Memory: 43690666 | ||
Upper Bound: | ||
Cpu: 15m | ||
Memory: 43690666 | ||
Events: <none> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# Copyright 2020 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
set +o xtrace | ||
|
||
repo="https://github.com/kubernetes/autoscaler.git" | ||
echo "Installing VPA ..." | ||
git clone $repo | ||
cd autoscaler/vertical-pod-autoscaler | ||
./hack/vpa-up.sh | ||
./pkg/admission-controller/gencerts.sh | ||
cd ../.. | ||
rm -rf autoscaler | ||
|
||
echo 'VPA installed successfully.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Copyright 2020 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
set +o xtrace | ||
|
||
repo="https://github.com/kubernetes/autoscaler.git" | ||
echo "Uninstalling VPA ..." | ||
git clone $repo | ||
cd autoscaler/vertical-pod-autoscaler | ||
./hack/vpa-down.sh | ||
cd ../.. | ||
rm -rf autoscaler | ||
|
||
echo 'VPA uninstalled successfully.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: autoscaling.k8s.io/v1 | ||
kind: VerticalPodAutoscaler | ||
metadata: | ||
name: csi-azuredisk-controller | ||
namespace: kube-system | ||
spec: | ||
targetRef: | ||
apiVersion: "apps/v1" | ||
kind: Deployment | ||
name: csi-azuredisk-controller | ||
resourcePolicy: | ||
containerPolicies: | ||
- containerName: '*' | ||
maxAllowed: | ||
memory: 50Gi | ||
controlledResources: ["memory"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters