Skip to content

Instantly share code, notes, and snippets.

@akshedu
Created June 21, 2021 03:19
Show Gist options
  • Save akshedu/95605246a4f7840f93381668656436a5 to your computer and use it in GitHub Desktop.
Save akshedu/95605246a4f7840f93381668656436a5 to your computer and use it in GitHub Desktop.
kops dryrun
#!/bin/sh
echo "Check if cluster config exists on S3"
if ! kops get cluster; then
echo "Create SSH Key"
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
echo "Create cluster config on S3"
kops create cluster --cloud aws --zones $AWS_ZONES
fi
echo "Create cluster.yaml and ig.yaml from templates"
kops toolbox template --values $AWS_REGION/base_values.yaml --values $AWS_REGION/$ENV_SUFFIX/values.yaml --template cluster.tpl --format-yaml=true --output cluster.yaml
kops toolbox template --values $AWS_REGION/base_values.yaml --values $AWS_REGION/$ENV_SUFFIX/values.yaml --template ig.tpl --format-yaml=true --output ig.yaml
echo "Replace cluster config on S3"
kops replace --force -f cluster.yaml
kops replace --force -f ig.yaml
echo "Dry run update"
kops update cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment