From 57ea17f332c1ac7b3a0338c4c792c6016976e6a5 Mon Sep 17 00:00:00 2001 From: Matt Snoby Date: Mon, 13 Feb 2017 21:43:54 -0500 Subject: [PATCH 1/2] Added documentation on downloading the kops spec config file --- docs/download_config.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/download_config.md diff --git a/docs/download_config.md b/docs/download_config.md new file mode 100644 index 0000000000..ca895dea3f --- /dev/null +++ b/docs/download_config.md @@ -0,0 +1,41 @@ +# Download kops config spec file +KOPS operates off of a config spec file that is generated during the create phase. It is uploaded to the amazon s3 bucket that is passed in during create. + +If you download the config spec file on a running cluster that is configured the way you like it, you can just pass that config spec file in to the create command and have kops create the cluster for you , `kops create -f spec_file` in a completely unattended manor. + +## How to download the config spec file. +Let's say you create your cluster with the following configuration options: + +``` +declare -x KOPS_STATE_STORE=s3://k8s-us-west +declare -x CLOUD=aws +declare -x ZONE="us-west-1a" +declare -x MASTER_ZONES="us-west-1a" +declare -x NAME=westtest.c.foo.com +declare -x K8S_VERSION=1.4.6 +declare -x NETWORKCIDER="10.240.0.0/16" +declare -x MASTER_SIZE="t2.medium" +declare -x WORKER_SIZE="t2.large" +``` +Next you call the kops command to create the cluster in your terminal: + +``` + kops create cluster $NAME \ + --cloud=$CLOUD \ + --zones="$ZONE" \ + --kubernetes-version=$K8S_VERSION \ + --master-zones="$MASTER_ZONES" \ + --node-count=3 \ + --node-size="$WORKER_SIZE" \ + --master-size="$MASTER_SIZE" \ + --network-cidr=${NETWORKCIDER} \ + --dns-zone=ZVO7KL181S5AP \ + --ssh-public-key=/Users/foo/.ssh/lab_no_password.pub +``` + +Your spec file will be located in your s3 bucket, in the location `s3://k8s-us-west/$NAME/config`. Using the above as an example the config file is located at `s3://k8s-us-west/westtest.c.foo.com/config` + +To download this file via the aws cli you can use the aws s3 copy command. Using the above cluster as an example the command would be + +`aws s3 cp $KOPS_STATE_STORE/$NAME/config ~/a_fun_name_you_will_remember.yml` + From c8a00d94e2db05eeb1b2b473ecae903fafab86c6 Mon Sep 17 00:00:00 2001 From: Matt Snoby Date: Wed, 19 Apr 2017 23:21:06 -0400 Subject: [PATCH 2/2] Added an additional method for downloading the spec file --- docs/download_config.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/download_config.md b/docs/download_config.md index ca895dea3f..4d449bea73 100644 --- a/docs/download_config.md +++ b/docs/download_config.md @@ -3,7 +3,8 @@ KOPS operates off of a config spec file that is generated during the create phas If you download the config spec file on a running cluster that is configured the way you like it, you can just pass that config spec file in to the create command and have kops create the cluster for you , `kops create -f spec_file` in a completely unattended manor. -## How to download the config spec file. +## How to download the config spec file. ( 2 possible ways ) + Let's say you create your cluster with the following configuration options: ``` @@ -33,9 +34,18 @@ Next you call the kops command to create the cluster in your terminal: --ssh-public-key=/Users/foo/.ssh/lab_no_password.pub ``` +### Method One - Kops command + +You can simply use the kops command `kops get cluster -o yaml > a_fun_name_you_will_remember.yml` + +Note: for the above command to work the cluster NAME and the KOPS_STATE_STORE will have to be exported in your environment. + +### Method Two - Manual method directly from s3 + Your spec file will be located in your s3 bucket, in the location `s3://k8s-us-west/$NAME/config`. Using the above as an example the config file is located at `s3://k8s-us-west/westtest.c.foo.com/config` To download this file via the aws cli you can use the aws s3 copy command. Using the above cluster as an example the command would be -`aws s3 cp $KOPS_STATE_STORE/$NAME/config ~/a_fun_name_you_will_remember.yml` +`aws s3 cp $KOPS_STATE_STORE/$NAME/config ~/a_fun_name_you_will_remember.yml` +