Stack Deploy - epam/hubctl GitHub Wiki
hub stack deploy and undeploy are wrappers around hub elaborate and hub deploy to simplify command-line experience.
hub stack experience builds on top of .hub/env/<domain>.{env,kubeconfig} files and a .env symlink pointing to current active configuration <domain>.env. Files could be created by hub configure or manually.
Let review a typical .env file with App stack configuration for Azure:
# stack definition files
HUB_FILES="hub.yaml params.yaml"
# deploy profiles are: local pod toolbox
HUB_DEPLOY_PROFILE="pod"
# Bubble DNS record TTL 72 hours. To renew run:
# hub configure -r aws --dns-update
HUB_STACK_NAME="ancient-odilee-431"
HUB_DOMAIN_NAME="ancient-odilee-431.epam.devops.delivery"
HUB_DOMAIN_SECRET="..."
HUB_BUBBLE_DNS="./.hub/env/ancient-odilee-431.epam.devops.delivery.bubble"
HUB_CLOUD_PROVIDER="azure"
AZURE_REGION="eastus2"
AZURE_SUBSCRIPTION_ID="966edf45-xxxx-xxxx-xxxx-xxxxxxxxxxx"
HUB_STATE_BUCKET="hubctl966edf45"
HUB_STATE_CONTAINER="hubctl"
HUB_STATE_REGION="eastus2"
HUB_STATE=".hub/ancient-odilee-431.epam.devops.delivery.state,az://hubctl966edf45/hubctl/ancient-odilee-431.epam.devops.delivery/hub/stack-app-eks/hub.state"
HUB_ELABORATE=".hub/ancient-odilee-431.epam.devops.delivery.elaborate,az://hubctl966edf45/hubctl/ancient-odilee-431.epam.devops.delivery/hub/stack-app-eks/hub.elaborate"
COMPONENT_DEX_PASSWORD_DB_EMAIL="[email protected]"
COMPONENT_DEX_PASSWORD_DB_PASSWORD="qwerty"
COMPONENT_HARBOR_PASSWORD="qwerty"
COMPONENT_POSTGRESQL_PASSWORD="qwerty23"
COMPONENT_POSTGRESQL_USER="postgres"
# Location of sandboxed kubeconfig
HUB_KUBECONFIG="/home/user/stack-app-eks/.hub/env/ancient-odilee-431.epam.devops.delivery.kubeconfig"-
HUB_FILEStellshub elaboratehow to assemble.hub/ancient-odilee-431.epam.devops.delivery.elaborate. -
podprofile is to launch provisioning operation in Kubernetes. - The domain of the stack is
ancient-odilee-431.epam.devops.deliveryprovided by Bubble DNS. - Azure is chosen cloud provider, deployment will be performed in
eastus2region in a specified Azure subscription. - Hub CLI state and Terraform state (if any) will be stored in
hubctl966edf45Azure Storage Account. - A number of
COMPONENT_*variables are provided to populatefromEnv:parameters declared inparams.yaml. - Prior to to deployment,
hub configuresaved a copy of Kubeconfing in.hub/env/ancient-odilee-431.epam.devops.delivery.kubeconfig.
hub stack deploy will export environment variables defined in .env and then it will launch hub elaborate and hub deploy.
Usage:
$ hub stack deploy
Deploys entire stack
$ hub stack deploy -c component1,component2
Deploys two components
$ hub stack deploy -c component1,component2 --profile pod
Deploys two components and executes deployment in a pod
Parameters:
-c --component List of components to deploy
--profile Can be: local | toolbox | pod
-o --offset Deploy starting with the given component
-l --limit Component to stop deploy at
-V --verbose Verbose outputs for debug purpose
--tty Use TTY (terminal) mode for hub deploy
--no-tty Do not use TTY (terminal) mode for hub deploy
-- Separator to define "hub deploy" low level parameters (see: "hub deploy --help")
-h --help Print this message