Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karpenter upgrade 0.16.1 #211

Merged
merged 14 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions content/karpenter/010_prerequisites/attach_workspaceiam.md

This file was deleted.

30 changes: 6 additions & 24 deletions content/karpenter/010_prerequisites/aws_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,20 @@ If you are at an AWS event, an AWS account was created for you to use throughout
You are now logged in to the AWS console in an account that was created for you, and will be available only throughout the workshop run time.

{{% notice info %}}
In the interest of time for shorter events we sometimes deploy the resources required as a prerequisite for you. If you were told so, please review the cloudformation outputs of the stack that was deployed by **expanding the instructions below**.
In the interest of time we have deployed everything required to run Karpenter for this workshop. All the pre-requisites and dependencies have been deployed. The resources deployed can befound in this CloudFormation Template (**[eks-spot-workshop-quickstarter-cnf.yml](https://raw.githubusercontent.com/awslabs/ec2-spot-workshops/master/content/using_ec2_spot_instances_with_eks/010_prerequisites/prerequisites.files/eks-spot-workshop-quickstart-cnf.yml)**). The template deploys resourcess such as (a) An [AWS Cloud9](https://console.aws.amazon.com/cloud9) workspace with all the dependencies and IAM privileges to run the workshop (b) An EKS Cluster with the name `eksworkshop-eksctl` and (c) a [EKS managed node group](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) with 2 on-demand instances.
{{% /notice %}}

{{%expand "Click to reveal detailed instructions" %}}
#### Getting access to Cloud9

#### What resources are already deployed {#resources_deployed}

We have deployed the below resources required to get started with the workshop using a CloudFormation Template (**[eks-spot-workshop-quickstarter-cnf.yml](https://raw.githubusercontent.com/awslabs/ec2-spot-workshops/master/content/using_ec2_spot_instances_with_eks/010_prerequisites/prerequisites.files/eks-spot-workshop-quickstart-cnf.yml)**), Please reference the below resources created by the stack.

+ An [AWS Cloud9](https://console.aws.amazon.com/cloud9) workspace with
- An IAM role created and attached to the workspace with Administrator access
- Kubernetes tools installed (kubectl, jq and envsubst)
- awscli upgraded to v2
- Created and imported a key pair to Amazon EC2
- [eksctl](https://eksctl.io/) installed, The official CLI for Amazon EKS

+ An EKS cluster with the name `eksworkshop-eksctl` and a [EKS managed node group](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) with 2 on-demand instances.


#### Use your resources

In this workshop, you'll need to reference the resources created by the CloudFormation stack that we setup for you.
In this workshop, you'll need to reference the resources created by the CloudFormation stack.

1. On the [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation), select the stack name that starts with **mod-** in the list.

1. In the stack details pane, click the **Outputs** tab.
2. In the stack details pane, click the **Outputs** tab.

![cnf_output](/images/karpenter/prerequisites/cnf_output.png)

It is recommended that you keep this window open so you can easily refer to the outputs and resources throughout the workshop.
It is recommended that you keep this tab / window open so you can easily refer to the outputs and resources throughout the workshop.

{{% notice info %}}
you will notice additional Cloudformation stacks were also deployed which is the result of the stack that starts with **mod-**. One to deploy the Cloud9 Workspace and two other to create the EKS cluster and managed nodegroup.
Expand All @@ -78,9 +62,7 @@ aws sts get-caller-identity

{{% insert-md-from-file file="karpenter/010_prerequisites/at_an_aws_validaterole.md" %}}

Since we have already setup the prerequisites, **you can head straight to [Test the Cluster]({{< relref "/karpenter/020_eksctl/test.md" >}})**

{{% /expand%}}


You are now ready to **[Test the Cluster]({{< relref "/karpenter/test.md" >}})**

28 changes: 0 additions & 28 deletions content/karpenter/010_prerequisites/awscli.md

This file was deleted.

58 changes: 0 additions & 58 deletions content/karpenter/010_prerequisites/k8stools.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AWSTemplateFormatVersion: '2010-09-09'
Description: AWS CloudFormation template to create a Cloud9 environment setup with kubectl, eksctl and an EKS cluster with a managed node group. Please allow ~20min for the EKS cluster to be ready.
Metadata:
Author:
Description: Sandeep Palavalasa <palavas@amazon.com>
Description: Carlos Rueda <ruecarlo@amazon.com>
License:
Description: 'Copyright 2020 Amazon.com, Inc. and its affiliates. All Rights Reserved.

Expand All @@ -20,29 +20,30 @@ Parameters:
C9InstanceType:
Description: Example Cloud9 instance type
Type: String
Default: t2.micro
Default: t3.micro
AllowedValues:
- t2.micro
- t3.micro
- m5.large
ConstraintDescription: Must be a valid Cloud9 instance type
C9KubectlVersion:
Description: Cloud9 instance kubectl version
Type: String
Default: v1.21.2
Default: v1.23.7
ConstraintDescription: Must be a valid kubectl version
C9KubectlVersionTEST:
Description: Cloud9 instance kubectl version
Type: String
Default: v1.21.2
Default: v1.23.7
ConstraintDescription: Must be a valid kubectl version
C9EKSctlVersion:
Description: Cloud9 instance eksctl version
Type: String
Default: v0.68.0
Default: v0.110.0
ConstraintDescription: Must be a valid eksctl version
EKSClusterVersion:
Description: EKS Cluster Version
Type: String
Default: 1.21
Default: 1.23
ConstraintDescription: Must be a valid eks version
EKSClusterName:
Description: EKS Cluster Name
Expand Down Expand Up @@ -160,7 +161,7 @@ Resources:
Fn::GetAtt:
- C9LambdaExecutionRole
- Arn
Runtime: python3.6
Runtime: python3.9
MemorySize: 256
Timeout: '600'
Code:
Expand Down Expand Up @@ -281,6 +282,7 @@ Resources:
- !Sub sed -i.bak -e 's/--AZB--/${AWS::Region}b/' /home/ec2-user/environment/eksworkshop.yaml
- !Sub sed -i.bak -e 's/--EKS_VERSION--/"'"${EKSClusterVersion}"'"/' /home/ec2-user/environment/eksworkshop.yaml
- sudo -H -u ec2-user /usr/local/bin/eksctl create cluster -f /home/ec2-user/environment/eksworkshop.yaml
- sudo -H -u ec2-user /usr/local/bin/aws eks update-kubeconfig --name eksworkshop-eksctl
- sudo -H -u ec2-user /usr/local/bin/kubectl get nodes

C9BootstrapAssociation:
Expand Down
55 changes: 53 additions & 2 deletions content/karpenter/010_prerequisites/self_paced.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ weight: 10
Only complete this section if you are running the workshop on your own. If you are at an AWS hosted event (such as re:Invent, Kubecon, Immersion Day, etc), go to [Start the workshop at an AWS event]({{< ref "/karpenter/010_prerequisites/aws_event.md" >}}).
{{% /notice %}}

### Running the workshop on your own
## Running the workshop on your own


### Creating an account to run the workshop

{{% notice warning %}}
Your account must have the ability to create new IAM roles and scope other IAM permissions.
Expand All @@ -33,5 +36,53 @@ as an IAM user with administrator access to the AWS account:
1. Take note of the login URL and save:
![Login URL](/images/karpenter/prerequisites/iam-4-save-url.png)

### Deploying CloudFormation

In the interest of time and to focus just on karpenter, we will install everything required to run this Karpenter workshop using cloudformation.

1. Download locally this cloudformation stack into a file (**[eks-spot-workshop-quickstarter-cnf.yml](https://raw.githubusercontent.com/awslabs/ec2-spot-workshops/master/content/using_ec2_spot_instances_with_eks/010_prerequisites/prerequisites.files/eks-spot-workshop-quickstart-cnf.yml)**).

1. Go into the CloudFormation console and select the creation of a new stack. Select **Template is ready**, and then **Upload a template file**, then select the file that you downloaded to your computer and click on **Next**

1. Fill in the **Stack Name** using 'karpenter-workshop', Leave all the settings in the parameters section with the default prarameters and click **Next**

1. In the Configure Stack options just scroll to the bottom of the page and click **Next**

1. Finally in the **Review karpenter-workshop** go to the bottom of the page and tick the `Capabilities` section *I acknowledge that AWS CloudFormation might create IAM resources.* then click **Create stack**

{{% notice warning %}}
The deployment of this stack may take up to 20minutes. You should wait until all the resources in the cloudformation stack have been completed before you start the rest of the workshop. The template deploys resourcess such as (a) An [AWS Cloud9](https://console.aws.amazon.com/cloud9) workspace with all the dependencies and IAM privileges to run the workshop (b) An EKS Cluster with the name `eksworkshop-eksctl` and (c) a [EKS managed node group](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) with 2 on-demand instances.
{{% /notice %}}

### Checking the completion of the stack deployment

One way to check your stack has been fully deployed is to check that all the cloudformation dependencies are green and succedded in the cloudformation dashboard; This should look similar to the state below.

![cnf_output](/images/karpenter/prerequisites/cfn_stak_completion.png)

#### Getting access to Cloud9

In this workshop, you'll need to reference the resources created by the CloudFormation stack.

1. On the [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation), select the stack name that starts with **mod-** in the list.

2. In the stack details pane, click the **Outputs** tab.

![cnf_output](/images/karpenter/prerequisites/cnf_output.png)

It is recommended that you keep this tab / window open so you can easily refer to the outputs and resources throughout the workshop.

{{% notice info %}}
you will notice additional Cloudformation stacks were also deployed which is the result of the stack that starts with **mod-**. One to deploy the Cloud9 Workspace and two other to create the EKS cluster and managed nodegroup.
{{% /notice %}}

#### Launch your Cloud9 workspace

- Click on the url against `Cloud9IDE` from the outputs

{{% insert-md-from-file file="karpenter/010_prerequisites/workspace_at_launch.md" %}}

{{% insert-md-from-file file="karpenter/010_prerequisites/update_workspace_settings.md" %}}


Once you have completed the step above, **you can head straight to [Create a Workspace]({{< ref "/karpenter/010_prerequisites/workspace.md" >}})**
You are now ready to **[Test the Cluster]({{< relref "/karpenter/test.md" >}})**
25 changes: 0 additions & 25 deletions content/karpenter/010_prerequisites/sshkey.md

This file was deleted.

52 changes: 0 additions & 52 deletions content/karpenter/010_prerequisites/update_workspaceiam.md

This file was deleted.

Loading