Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AKS #1225

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ AUTOTUNE_QUERY_VARIABLES_MANIFEST_TEMPLATE="${AUTOTUNE_DIR}/autotune-query-varia
AUTOTUNE_QUERY_VARIABLES_MANIFEST="${AUTOTUNE_DIR}/autotune-query-variables/query-variable.yaml"
KRUIZE_CRC_DEPLOY_MANIFEST_OPENSHIFT="${CRC_DIR}/openshift/kruize-crc-openshift.yaml"
KRUIZE_CRC_DEPLOY_MANIFEST_MINIKUBE="${CRC_DIR}/minikube/kruize-crc-minikube.yaml"
KRUIZE_CRC_DEPLOY_MANIFEST_AKS="${CRC_DIR}/aks/kruize-crc-aks.yaml"

AUTOTUNE_PORT="8080"
AUTOTUNE_DOCKER_REPO="docker.io/kruize/autotune_operator"
AUTOTUNE_DOCKER_REPO="quay.io/kruize/autotune_operator"

Comment on lines -48 to 50
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change would help with docker rate limiting

#Fetch autotune version from the pom.xml file.
AUTOTUNE_VERSION="$(grep -A 1 "autotune" "${ROOT_DIR}"/pom.xml | grep version | awk -F '>' '{ split($2, a, "<"); print a[1] }')"
Expand All @@ -63,6 +64,7 @@ HPO_DOCKER_IMAGE=${HPO_DOCKER_REPO}:${HPO_VERSION}

# source all the helpers scripts
. "${SCRIPTS_DIR}"/minikube-helpers.sh
. "${SCRIPTS_DIR}"/aks-helpers.sh
. "${SCRIPTS_DIR}"/openshift-helpers.sh
. "${SCRIPTS_DIR}"/common_utils.sh

Expand Down Expand Up @@ -96,7 +98,7 @@ trap "ctrlc_handler" 1 2 3

function usage() {
echo
echo "Usage: $0 [-a] [-k url] [-c [docker|minikube|openshift]] [-i autotune docker image] [-o hpo docker image] [-n namespace] [-d configmaps-dir ] [--timeout=x, x in seconds, for docker only]"
echo "Usage: $0 [-a] [-k url] [-c [docker|minikube|openshift|aks]] [-i autotune docker image] [-o hpo docker image] [-n namespace] [-d configmaps-dir ] [--timeout=x, x in seconds, for docker only]"
echo " -s = start(default), -t = terminate"
echo " -s: Deploy autotune [Default]"
echo " -t: Terminate autotune deployment"
Expand All @@ -113,7 +115,7 @@ function usage() {
# Check if the cluster_type is one of icp or openshift
function check_cluster_type() {
case "${cluster_type}" in
docker | minikube | openshift) ;;
docker | minikube | openshift | aks) ;;

*)
echo "Error: unsupported cluster type: ${cluster_type}"
Expand Down Expand Up @@ -187,7 +189,7 @@ done
# Call the proper setup function based on the cluster_type
if [ ${setup} == 1 ]; then
if [ ${target} == "crc" ]; then
if [ ${cluster_type} == "minikube" ] || [ ${cluster_type} == "openshift" ]; then
if [ ${cluster_type} == "minikube" ] || [ ${cluster_type} == "openshift" ] || [ ${cluster_type} == "aks" ]; then
${cluster_type}_crc_start
else
echo "Unsupported cluster!"
Expand Down
38 changes: 36 additions & 2 deletions docs/autotune_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Autotune can be deployed to a supported Kubernetes cluster. We currently support
Minikube setup with 8 CPUs and 16 GB Memory is recommended for autotune deployment. After setting up minikube, install prometheus from autotune repo with the following command

```
$ ./scripts/prometheus_on_minikube.sh -as
$ ./scripts/prometheus_on_minikube.sh -as

Info: installing prometheus...

Expand Down Expand Up @@ -69,7 +69,7 @@ $ ./build.sh -i autotune:test
Note - You can use the 'dev friendly mode' option to quickly build the autotune docker image using the cached layers.


# Deploy Autotune
# Deploy Autotune on minikube

Let us now deploy autotune using the docker image onto the minikube cluster

Expand Down Expand Up @@ -125,6 +125,40 @@ autotune-58cf47df84-rhqhx 1/1 Running 0 54s
Info: Access Autotune at http://192.168.39.12:30113/listKruizeTunables
```

### Install Prometheus on AKS

This step assumes you have AKS installed and running,. After setting up AKS, install prometheus from autotune repo with the following command

```
$ ./scripts/prometheus_on_aks.sh -as

Info: Installing Prometheus on AKS
...

Info: Prometheus Setup on AKS
No resources found in monitoring namespace.
Info: Cloning Prometheus Operator & few AKS Customisations git

```
# Deploy Autotune on AKS

Let us now deploy autotune container image onto the Azure Kubernetes cluster
```
$ ./deploy.sh -c aks

Usage: ./deploy.sh [-c [docker|minikube|openshift]] [-i autotune docker image] [-o hpo docker image] [-n namespace] [-d configmaps-dir ] [-s start] [-t terminate]
-s: Deploy autotune [Default]
-t: Terminate autotune deployment
-c: kubernetes cluster type. At present we support only minikube [Default - minikube]
-i: deploy with specific autotune operator docker image name [Default - kruize/autotune_operator:<version from pom.xml>]
-o: deploy with specific hpo docker image name [Default - kruize/hpo:<current hpo version>]
-n: Namespace to which autotune is deployed [Default - monitoring for cluster type minikube]
-d: Config maps directory [Default - manifests/configmaps]

For example,
./deploy.sh -c aks -i <docker hub user>/autotune_operator:test -o <docker hub user>/hpo:test
```

# Demo

Please see the [demo](https://github.com/kruize/kruize-demos) repo for more details on how to use Autotune.
28 changes: 28 additions & 0 deletions manifests/autotune/configmaps/aks-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: autotune-config
data:
cluster_type: "kubernetes"
k8s_type: "aks"
auth_type: ""
auth_token: ""
monitoring_agent: "prometheus"
monitoring_service: "prometheus-k8s"
monitoring_agent_endpoint: ""
root_logging_level: "error"
logging_level: "info"
kruizeconfigjson: |
{
"datasource": [
{
"name": "prometheus-1",
"provider": "prometheus",
"serviceName": "prometheus-k8s",
"namespace": "monitoring",
"url": ""
}
]
}


Loading