Skip to content

Commit

Permalink
[ISSUE-64] Allow option to skip installing software (#65)
Browse files Browse the repository at this point in the history
- Added install_software config parameter to prevent aladdin from doing infra/software installation and management

[64](#64)
  • Loading branch information
phani-kandula-fivestars authored Sep 4, 2020
1 parent 6416c3b commit ac2df74
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ You will now need to [create your aladdin configuration](./docs/create_aladdin_c

$ aladdin config set config_dir /path/to/aladdin/configuration

### Manage configuration
#### Software dependencies
aladdin installs software it needs like helm, jq, aws cli etc.

But you may not need that if this applies to your situation:
1. You already have a separate process for config management of your machine.
1. You want to keep using your tools (scripts, ansible playbook etc).
1. You don't want aladdin to install any software.

Then run:

```
aladdin config set manage.software_dependencies false
```

### VM Configuration
Currently, the following parameters are configurable:
* memory: By default, we create a minikube vm with 4096MB (4GB) of memory. To change the size of the vm we create to e.g. 8GB, you may run:
Expand Down
18 changes: 16 additions & 2 deletions aladdin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NAMESPACE=default
IS_TERMINAL=true
SKIP_PROMPTS=false
KUBERNETES_VERSION="1.15.6"
MANAGE_SOFTWARE_DEPENDENCIES=true

# Set key directory paths
ALADDIN_DIR="$(cd "$(dirname "$0")" ; pwd)"
Expand Down Expand Up @@ -52,6 +53,14 @@ function get_plugin_dir() {
fi
}

function get_manage_software_dependencies() {
if [[ -f "$HOME/.aladdin/config/config.json" ]]; then
MANAGE_SOFTWARE_DEPENDENCIES=$(jq -r .manage.software_dependencies $HOME/.aladdin/config/config.json)
if [[ "$MANAGE_SOFTWARE_DEPENDENCIES" == null ]]; then
MANAGE_SOFTWARE_DEPENDENCIES=true
fi
fi
}
# Check for cluster name aliases and alias them accordingly
function check_cluster_alias() {
cluster_alias=$(jq -r --arg key "$CLUSTER_CODE" '.cluster_aliases[$key]' "$ALADDIN_CONFIG_FILE")
Expand All @@ -74,7 +83,9 @@ function check_and_handle_init() {
fi
# Handle initialization logic
if "$INIT"; then
"$SCRIPT_DIR"/infra_k8s_check.sh --force
if "$MANAGE_SOFTWARE_DEPENDENCIES"; then
"$SCRIPT_DIR"/infra_k8s_check.sh --force
fi
enter_minikube_env
copy_ssh_to_minikube
minikube addons enable ingress > /dev/null
Expand All @@ -86,7 +97,9 @@ function check_and_handle_init() {
docker pull "$aladdin_image"
echo "$current_time" > "$last_launched_file"
else
"$SCRIPT_DIR"/infra_k8s_check.sh
if "$MANAGE_SOFTWARE_DEPENDENCIES"; then
"$SCRIPT_DIR"/infra_k8s_check.sh
fi
enter_minikube_env
fi
}
Expand Down Expand Up @@ -385,6 +398,7 @@ done
exec_host_command "$@"
get_config_path
get_plugin_dir
get_manage_software_dependencies
exec_host_plugin "$@"
check_cluster_alias
check_and_handle_init
Expand Down

0 comments on commit ac2df74

Please sign in to comment.