From 28538cd5c002be220826a8e570a637020aa95bdc Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Wed, 7 Feb 2018 13:25:15 -0800 Subject: [PATCH 1/2] coreupdate: document serving packages from s3 --- coreupdate/coreupdate-aws-s3.md | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 coreupdate/coreupdate-aws-s3.md diff --git a/coreupdate/coreupdate-aws-s3.md b/coreupdate/coreupdate-aws-s3.md new file mode 100644 index 000000000..dd1f3d691 --- /dev/null +++ b/coreupdate/coreupdate-aws-s3.md @@ -0,0 +1,58 @@ +# Configure CoreUpdate to Serve Packages from AWS S3 + +The [updateservicectl][updateservicectl] tool can be used to fetch Container Linux updates from upstream and push the update payload to AWS S3. This process is documented for a general file server at: [CoreUpdate - Air Gapped Package Management][airgap] + +Download the update payload from the upstream public CoreUpdate instance. The command below fetches the update payload for Container Linux release 1632.2.1: + +``` +$ updateservicectl --server=https://public.update.core-os.net package download --dir=/packages/ --version=1632.2.1 +``` + +Now the /packages/ directory contains a json file with update metadata and the gzipped update payload: + +``` +$ tree packages +packages +├── e96281a6-d1af-4bde-9a0a-97b76e56dc57_1632.2.1_info.json +└── e96281a6-d1af-4bde-9a0a-97b76e56dc57_1632.2.1_update.gz + +0 directories, 2 files +``` + +Use the `updateservicectl package create bulk` command to create the package on an CoreUpdate instance. In the example below, CoreUpdate is running at: `http://coreupdate.example.com:8000`. + +``` +$ updateservicectl --server=http://coreupdate.example.com:8000 --user=admin --key=4025a24d-b1e4-4294-b0ca package create bulk --base-url=https://s3-us-west-1.amazonaws.com/core-update-support --dir=/packages +``` + +Note the use of the flags `--user` and `--key` these will be required. Most often the user will be `admin` and the key can be found in the `/etc/coreupdate/config.yaml` file. + +Be certain to format the URL passed to the `--base-url` flag as described in the AWS document: " [AWS S3 Regions and Endpoints][aws-endpoints]". + +On successful creation of the package, the output of this command will state where to upload payloads: + +``` +2018/02/06 15:59:41 Creating package with AppId=e96281a6-d1af-4bde-9a0a-97b76e56dc57 and Version=1632.2.1 +2018/02/06 15:59:41 Package metadata uploaded. Total=1 Errors=0 +2018/02/06 15:59:41 Please upload payloads to https://s3-us-west-1.amazonaws.com/core-update-support. +``` + +Upload the update package to s3: + +``` +aws s3 cp /packages/e96281a6-d1af-4bde-9a0a-97b76e56dc57_1632.2.1_update.gz s3://core-update-support +``` + +Access is a very important thing to consider. It is required to have a bucket policy that will allow the machines updating to download the payload. A tool such as `curl` can be used to verify the payload can be fetched: + +``` +curl -L https://s3-us-west-1.amazonaws.com/core-update-support/e96281a6-d1af-4bde-9a0a-97b76e56dc57_1632.2.1_update.gz -o test.gz +``` + +Consult the document [CoreUpdate - Configure Machines][core-update-config] for details on configuring a Container Linux host to use CoreUpdate. + +[updateservicectl]: https://github.com/coreos/updateservicectl/releases +[airgap]: https://coreos.com/products/coreupdate/docs/latest/on-premises-deployment.html#air-gapped-package-management +[aws-endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region +[core-update-config]: https://coreos.com/products/coreupdate/docs/latest/configure-machines.html + From a4c7edd52a1a642b5e8fd1bd29727052e64a17c4 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Wed, 7 Mar 2018 14:04:53 -0800 Subject: [PATCH 2/2] spelling and format updates --- coreupdate/coreupdate-aws-s3.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/coreupdate/coreupdate-aws-s3.md b/coreupdate/coreupdate-aws-s3.md index dd1f3d691..493f97818 100644 --- a/coreupdate/coreupdate-aws-s3.md +++ b/coreupdate/coreupdate-aws-s3.md @@ -1,4 +1,4 @@ -# Configure CoreUpdate to Serve Packages from AWS S3 +# Configure CoreUpdate to serve packages from AWS S3 The [updateservicectl][updateservicectl] tool can be used to fetch Container Linux updates from upstream and push the update payload to AWS S3. This process is documented for a general file server at: [CoreUpdate - Air Gapped Package Management][airgap] @@ -8,7 +8,7 @@ Download the update payload from the upstream public CoreUpdate instance. The co $ updateservicectl --server=https://public.update.core-os.net package download --dir=/packages/ --version=1632.2.1 ``` -Now the /packages/ directory contains a json file with update metadata and the gzipped update payload: +Now the /packages/ directory contains a JSON file with update metadata and the Gzipped update payload: ``` $ tree packages @@ -19,7 +19,7 @@ packages 0 directories, 2 files ``` -Use the `updateservicectl package create bulk` command to create the package on an CoreUpdate instance. In the example below, CoreUpdate is running at: `http://coreupdate.example.com:8000`. +Use the `updateservicectl package create bulk` command to create the package on a CoreUpdate instance. In the example below, CoreUpdate is running at: `http://coreupdate.example.com:8000`. ``` $ updateservicectl --server=http://coreupdate.example.com:8000 --user=admin --key=4025a24d-b1e4-4294-b0ca package create bulk --base-url=https://s3-us-west-1.amazonaws.com/core-update-support --dir=/packages @@ -27,7 +27,7 @@ $ updateservicectl --server=http://coreupdate.example.com:8000 --user=admin --ke Note the use of the flags `--user` and `--key` these will be required. Most often the user will be `admin` and the key can be found in the `/etc/coreupdate/config.yaml` file. -Be certain to format the URL passed to the `--base-url` flag as described in the AWS document: " [AWS S3 Regions and Endpoints][aws-endpoints]". +Be certain to format the URL passed to the `--base-url` flag as described in the AWS document: "[AWS S3 Regions and Endpoints][aws-endpoints]". On successful creation of the package, the output of this command will state where to upload payloads: @@ -37,7 +37,7 @@ On successful creation of the package, the output of this command will state whe 2018/02/06 15:59:41 Please upload payloads to https://s3-us-west-1.amazonaws.com/core-update-support. ``` -Upload the update package to s3: +Upload the update package to the S3 bucket: ``` aws s3 cp /packages/e96281a6-d1af-4bde-9a0a-97b76e56dc57_1632.2.1_update.gz s3://core-update-support @@ -51,8 +51,9 @@ curl -L https://s3-us-west-1.amazonaws.com/core-update-support/e96281a6-d1af-4bd Consult the document [CoreUpdate - Configure Machines][core-update-config] for details on configuring a Container Linux host to use CoreUpdate. + [updateservicectl]: https://github.com/coreos/updateservicectl/releases -[airgap]: https://coreos.com/products/coreupdate/docs/latest/on-premises-deployment.html#air-gapped-package-management +[airgap]: on-premises-deployment.html#air-gapped-package-management [aws-endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region -[core-update-config]: https://coreos.com/products/coreupdate/docs/latest/configure-machines.html +[core-update-config]: configure-machines.html