This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Spinnaker templates to use Halyard
1. Simplify the config by using Halyard 2. Deploy spinnaker _to_ the k8s cluster rather than the VM 3. Deprecate the 201 template
- Loading branch information
Showing
16 changed files
with
327 additions
and
866 deletions.
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 |
---|---|---|
|
@@ -22,11 +22,8 @@ This repository contains utility scripts to run/configure DevOp systems in Azure | |
1. Deploy to a development environment | ||
1. Wait for manual judgement | ||
1. Deploy to a production environment | ||
* [await_restart_service.sh](spinnaker/await_restart_service/): Restarts a Spinnaker service and waits for the service to be open for requests. | ||
* [configure_k8s.sh](spinnaker/configure_k8s/): Automatically configure a spinnaker instance to target a Kubernetes cluster and Azure Container Registry. | ||
* [configure_vmss.sh](spinnaker/configure_vmss/): Automatically configure a Spinnaker instance to target VM Scale Sets and a Jenkins instance hosting an Aptly repository. | ||
* [copy_kube_config.sh](spinnaker/copy_kube_config/): Programatically copies a kubeconfig file from an Azure Container Service Kubernetes cluster to a Spinnaker machine. | ||
* [install_spinnaker.sh](spinnaker/install_spinnaker/): Install Spinnaker and automatically configure it to use Azure Storage (azs) as its persistent storage. | ||
* [install_halyard.sh](spinnaker/install_halyard/): Install Halyard and automatically configure Spinnaker to use Azure Storage (azs) as its persistent storage. | ||
|
||
## Questions/Comments? [email protected] | ||
|
||
|
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,77 @@ | ||
#!/bin/bash | ||
|
||
function print_usage() { | ||
cat <<EOF | ||
Command | ||
$0 | ||
Arguments | ||
--storage_account_name|-san [Required] : Storage Account name used for Spinnaker's persistent storage | ||
--storage_account_key|-sak [Required] : Storage Account key used for Spinnaker's persistent storage | ||
--username|-u [Required] : User for which to install Halyard | ||
--artifacts_location|-al : Url used to reference other scripts/artifacts. | ||
--sas_token|-st : A sas token needed if the artifacts location is private. | ||
EOF | ||
} | ||
|
||
function throw_if_empty() { | ||
local name="$1" | ||
local value="$2" | ||
if [ -z "$value" ]; then | ||
echo "Parameter '$name' cannot be empty." 1>&2 | ||
print_usage | ||
exit -1 | ||
fi | ||
} | ||
|
||
function run_util_script() { | ||
local script_path="$1" | ||
shift | ||
curl --silent "${artifacts_location}${script_path}${artifacts_location_sas_token}" | sudo bash -s -- "$@" | ||
local return_value=$? | ||
if [ $return_value -ne 0 ]; then | ||
>&2 echo "Failed while executing script '$script_path'." | ||
exit $return_value | ||
fi | ||
} | ||
|
||
while [[ $# > 0 ]] | ||
do | ||
key="$1" | ||
shift | ||
case $key in | ||
--storage_account_name|-san) | ||
storage_account_name="$1";; | ||
--storage_account_key|-sak) | ||
storage_account_key="$1";; | ||
--username|-u) | ||
username="$1";; | ||
--artifacts_location|-al) | ||
artifacts_location="$1";; | ||
--sas_token|-st) | ||
artifacts_location_sas_token="$1";; | ||
--help|-help|-h) | ||
print_usage | ||
exit 13;; | ||
*) | ||
echo "ERROR: Unknown argument '$key' to script '$0'" 1>&2 | ||
exit -1 | ||
esac | ||
shift | ||
done | ||
|
||
throw_if_empty storage_account_name $storage_account_name | ||
throw_if_empty storage_account_key $storage_account_key | ||
throw_if_empty username $username | ||
|
||
run_util_script "spinnaker/install_halyard/install_halyard.sh" -san "$storage_account_name" -sak "$storage_account_key" -u "$username" | ||
|
||
sudo hal deploy apply | ||
|
||
# Wait for Spinnaker services to be up before returning | ||
timeout=180 | ||
echo "while !(nc -z localhost 8084) || !(nc -z localhost 9000); do sleep 1; done" | timeout $timeout bash | ||
return_value=$? | ||
if [ $return_value -ne 0 ]; then | ||
>&2 echo "Failed to connect to Spinnaker within '$timeout' seconds." | ||
exit $return_value | ||
fi |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.