Skip to content

Commit

Permalink
Merge pull request #1686 from tjkirch/default-1.21
Browse files Browse the repository at this point in the history
Update default variant to aws-k8s-1.21
  • Loading branch information
tjkirch authored Aug 3, 2021
2 parents 4c82044 + 31dac27 commit edabbd9
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To build an image, run:
cargo make
```

This will build an image for the default variant, `aws-k8s-1.19`.
This will build an image for the default variant, `aws-k8s-1.21`.
All packages will be built in turn, and then compiled into an `img` file in the `build/images/` directory.

The version number in [Release.toml](Release.toml) will be used in naming the file, and will be used inside the image as the release version.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BUILDSYS_VERSION_BUILD = { script = ["git describe --always --dirty --exclude '*
BUILDSYS_RELEASE_CONFIG_PATH = "${BUILDSYS_ROOT_DIR}/Release.toml"
BUILDSYS_VERSION_IMAGE = { script = ["awk -F '[ =\"]+' '$1 == \"version\" {print $2}' ${BUILDSYS_RELEASE_CONFIG_PATH}"] }
# This can be overridden with -e to build a different variant from the variants/ directory
BUILDSYS_VARIANT = "aws-k8s-1.19"
BUILDSYS_VARIANT = "aws-k8s-1.21"
# Product name used for file and directory naming
BUILDSYS_NAME = "bottlerocket"
# "Pretty" name used to identify OS in os-release, bootloader, etc.
Expand Down
6 changes: 3 additions & 3 deletions PUBLISHING-AWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This isn't very discoverable yet, but it's useful for testing.
As an example, a parameter might look like this:

```
/your/prefix/here/aws-k8s-1.19/x86_64/1.0.1-dafe3b16/image_id
/your/prefix/here/aws-k8s-1.21/x86_64/1.0.1-dafe3b16/image_id
```

Once you're satisfied with your image and parameters, you can promote the parameters to simpler names (for example, "latest") using the [instructions below](#promoting-ssm-parameters).
Expand Down Expand Up @@ -128,12 +128,12 @@ cargo make promote-ssm -e SSM_TARGET=latest
This will copy the fully versioned parameter from earlier, something like:

```
/your/prefix/here/aws-k8s-1.19/x86_64/1.0.1-dafe3b16/image_id
/your/prefix/here/aws-k8s-1.21/x86_64/1.0.1-dafe3b16/image_id
```

...to a simpler parameter name:
```
/your/prefix/here/aws-k8s-1.19/x86_64/latest/image_id
/your/prefix/here/aws-k8s-1.21/x86_64/latest/image_id
```

You can then use this parameter name to get the latest AMI ID.
Expand Down
4 changes: 2 additions & 2 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ These default settings will be applied to your hosts at startup, meaning any hos

The easiest way to change your repo URLs at run time is to include the settings changes in user data.
This method is covered [in README](README.md#using-user-data).
For example, if you built the `aws-k8s-1.19` variant for `x86_64` and uploaded to the public S3 bucket `my-bucket`, your URLs could look like:
For example, if you built the `aws-k8s-1.21` variant for `x86_64` and uploaded to the public S3 bucket `my-bucket`, your URLs could look like:

```toml
[settings.updates]
targets-base-url = "https://my-bucket.s3-us-west-2.amazonaws.com/targets/"
metadata-base-url = "https://my-bucket.s3-us-west-2.amazonaws.com/aws-k8s-1.19/x86_64/"
metadata-base-url = "https://my-bucket.s3-us-west-2.amazonaws.com/aws-k8s-1.21/x86_64/"
```

### Waves
Expand Down
12 changes: 6 additions & 6 deletions QUICKSTART-EKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ us-west-2
```

The official AMI IDs are stored in [public SSM parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-public-parameters.html).
The parameter names look like this: `/aws/service/bottlerocket/aws-k8s-1.19/x86_64/latest/image_id`
The parameter names look like this: `/aws/service/bottlerocket/aws-k8s-1.21/x86_64/latest/image_id`

Just change the variant (`aws-k8s-1.19`) and architecture (`x86_64`) to the ones you want to use.
Just change the variant (`aws-k8s-1.21`) and architecture (`x86_64`) to the ones you want to use.
Supported variants and architectures are described in the [README](README.md#variants).
For the purposes of SSM parameters, the valid architecture names are `x86_64` and `arm64` (also known as `aarch64`).
Also, if you know a specific Bottlerocket version you'd like to use, for example `1.0.6`, you can replace `latest` with that version.
Expand All @@ -135,22 +135,22 @@ Once you have the parameter name you want to use, the easiest way to use it is t
(You can also use this method for CloudFormation and other services that launch EC2 instances for you.)
Just prefix the parameter name with `resolve:ssm:` and EC2 will fetch the current value for you.

For example, to use the parameter above, you would pass this as the AMI ID in your launch request: `resolve:ssm:/aws/service/bottlerocket/aws-k8s-1.19/x86_64/latest/image_id`
For example, to use the parameter above, you would pass this as the AMI ID in your launch request: `resolve:ssm:/aws/service/bottlerocket/aws-k8s-1.21/x86_64/latest/image_id`

#### Manually querying SSM

If you prefer to fetch the AMI ID yourself, you can use [aws-cli](https://aws.amazon.com/cli/) on the command line.
To fetch the example parameter above, for the us-west-2 region, you could run this:

```
aws ssm get-parameter --region us-west-2 --name "/aws/service/bottlerocket/aws-k8s-1.19/x86_64/latest/image_id" --query Parameter.Value --output text
aws ssm get-parameter --region us-west-2 --name "/aws/service/bottlerocket/aws-k8s-1.21/x86_64/latest/image_id" --query Parameter.Value --output text
```

If you have `jq` and would like a bit more information, try this:
```
aws ssm get-parameters --region us-west-2 \
--names "/aws/service/bottlerocket/aws-k8s-1.19/x86_64/latest/image_id" \
"/aws/service/bottlerocket/aws-k8s-1.19/x86_64/latest/image_version" \
--names "/aws/service/bottlerocket/aws-k8s-1.21/x86_64/latest/image_id" \
"/aws/service/bottlerocket/aws-k8s-1.21/x86_64/latest/image_version" \
--output json | jq -r '.Parameters | .[] | "\(.Name): \(.Value) (updated \(.LastModifiedDate | gmtime | strftime("%c")) UTC)"'
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ We’re excited to get early feedback and to continue working on more use cases!
Bottlerocket is architected such that different cloud environments and container orchestrators can be supported in the future.
A build of Bottlerocket that supports different features or integration characteristics is known as a 'variant'.
The artifacts of a build will include the architecture and variant name.
For example, an `x86_64` build of the `aws-k8s-1.19` variant will produce an image named `bottlerocket-aws-k8s-1.19-x86_64-<version>-<commit>.img`.
For example, an `x86_64` build of the `aws-k8s-1.21` variant will produce an image named `bottlerocket-aws-k8s-1.21-x86_64-<version>-<commit>.img`.

The following variants support EKS, as described above:

Expand Down Expand Up @@ -694,7 +694,7 @@ We currently package the following major third-party components:
* systemd as init ([background](https://en.wikipedia.org/wiki/Systemd), [packaging](packages/systemd/))
* wicked for networking ([background](/~https://github.com/openSUSE/wicked), [packaging](packages/wicked/))
* containerd ([background](https://containerd.io/), [packaging](packages/containerd/))
* Kubernetes ([background](https://kubernetes.io/), [packaging](packages/kubernetes-1.19/))
* Kubernetes ([background](https://kubernetes.io/), [packaging](packages/kubernetes-1.21/))
* aws-iam-authenticator ([background](/~https://github.com/kubernetes-sigs/aws-iam-authenticator), [packaging](packages/aws-iam-authenticator/))
* Amazon ECS agent ([background](/~https://github.com/aws/amazon-ecs-agent), [packaging](packages/ecs-agent/))

Expand Down
2 changes: 1 addition & 1 deletion sample-eksctl-ssh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterConfig
metadata:
name: bottlerocket
region: us-west-2
version: '1.19'
version: '1.21'

nodeGroups:
- name: ng-bottlerocket
Expand Down
2 changes: 1 addition & 1 deletion sample-eksctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterConfig
metadata:
name: bottlerocket
region: us-west-2
version: '1.19'
version: '1.21'

nodeGroups:
- name: ng-bottlerocket
Expand Down
10 changes: 5 additions & 5 deletions sources/models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and

### aws-k8s-1.17: Kubernetes 1.17

* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)

### aws-k8s-1.18: Kubernetes 1.18

* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)

### aws-k8s-1.19: Kubernetes 1.19

* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)

### aws-k8s-1.20: Kubernetes 1.20

* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.21/defaults.d/)

### aws-k8s-1.21: Kubernetes 1.21

* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.21/defaults.d/)

### aws-ecs-1: Amazon ECS
Expand Down
28 changes: 0 additions & 28 deletions sources/models/src/aws-k8s-1.19/mod.rs

This file was deleted.

1 change: 1 addition & 0 deletions sources/models/src/aws-k8s-1.19/mod.rs
1 change: 0 additions & 1 deletion sources/models/src/aws-k8s-1.21/mod.rs

This file was deleted.

28 changes: 28 additions & 0 deletions sources/models/src/aws-k8s-1.21/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use model_derive::model;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use crate::modeled_types::Identifier;
use crate::{
AwsSettings, BootstrapContainer, HostContainer, KernelSettings, KubernetesSettings,
MetricsSettings, NetworkSettings, NtpSettings, PemCertificate, RegistrySettings,
UpdatesSettings,
};

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: String,
kubernetes: KubernetesSettings,
updates: UpdatesSettings,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: NtpSettings,
network: NetworkSettings,
kernel: KernelSettings,
aws: AwsSettings,
metrics: MetricsSettings,
pki: HashMap<Identifier, PemCertificate>,
container_registry: RegistrySettings,
}
10 changes: 5 additions & 5 deletions sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and
## aws-k8s-1.17: Kubernetes 1.17
* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)
## aws-k8s-1.18: Kubernetes 1.18
* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)
## aws-k8s-1.19: Kubernetes 1.19
* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.19/defaults.d/)
## aws-k8s-1.20: Kubernetes 1.20
* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.21/defaults.d/)
## aws-k8s-1.21: Kubernetes 1.21
* [Model](src/aws-k8s-1.19/mod.rs)
* [Model](src/aws-k8s-1.21/mod.rs)
* [Default settings](src/aws-k8s-1.21/defaults.d/)
## aws-ecs-1: Amazon ECS
Expand Down

0 comments on commit edabbd9

Please sign in to comment.