You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-13Lines changed: 39 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,23 @@
1
1
# k3s-aws-cdk
2
+
This is a CDK project to deploy a k3s cluster on AWS. After running the CDK stack, you will have a k3s cluster running on an EC2 instance in AWS. The k3s cluster will be deployed using the user data script in the `src/user_data.sh` file. The user data script will install k3s on the EC2 instance and configure it as a server node.
2
3
3
-
This is a CDK project to deploy a k3s cluster on AWS.
4
+
## What is k3s?
5
+
k3s is a lightweight Kubernetes distribution that is easy to install and run. It is designed for edge computing, IoT, and CI/CD pipelines. For more information, visit the [k3s website](https://docs.k3s.io/).
- AWS CDK Toolkit (Instalwith your AWS account credentials. You can do this by running `aws configure` and entering your AWS Access Key ID, AWS Secret Access Key, default region name, and default output format.
11
13
12
-
## Setup
14
+
## Confugure AWS CLI
15
+
Before you can deploy the CDK stack, you need to configure the AWS CLI with your AWS account credentials. You can do this by running `aws configure` and entering your AWS Access Key ID, AWS Secret Access Key, default region name, and default output format.
16
+
```bash
17
+
aws configure
18
+
```
19
+
20
+
## Installation
13
21
14
22
```bash
15
23
# Create virtualenv
@@ -30,23 +38,33 @@ python --version #My version is 3.13.1
30
38
pip install -r requirements.txt
31
39
```
32
40
41
+
## Usage
33
42
34
-
At this point you can now synthesize the CloudFormation template for this code.
43
+
At this point, you can now synthesize the CloudFormation template for this code.
35
44
36
-
```
37
-
$ cdk synth
45
+
```bash
46
+
cdk synth
38
47
```
39
48
40
-
You can now begin exploring the source code, contained in the hello directory.
41
-
There is also a very trivial test included that can be run like this:
49
+
If the CloudFormation template looks good, you can now deploy the stack.
42
50
51
+
```bash
52
+
cdk deploy
43
53
```
44
-
$ pytest
54
+
55
+
Before deploying the stack, you can also run a diff to see the changes that will be made to your AWS account.
56
+
```bash
57
+
cdk diff
45
58
```
46
59
47
-
To add additional dependencies, for example other CDK libraries, just add to
48
-
your requirements.txt file and rerun the `pip install -r requirements.txt`
49
-
command.
60
+
## Expected Output
61
+
62
+
After deploying the stack, you will have a k3s cluster running on an EC2 instance in AWS. The expected output includes:
63
+
64
+
- A security group allowing SSH, HTTP, HTTPS, and Kubernetes API access.
65
+
- An IAM role with policies for EC2 read-only access, SSM managed instance core, and ECR pull-only access.
66
+
- An EC2 instance running the k3s cluster with the specified user data script.
67
+
- Public IP address and instance ID of the deployed EC2 instance.
50
68
51
69
## Useful commands
52
70
@@ -56,4 +74,12 @@ command.
56
74
*`cdk diff` compare deployed stack with current state
57
75
*`cdk docs` open CDK documentation
58
76
59
-
Enjoy!
77
+
## Contributing
78
+
79
+
Contributions are welcome! Please feel free to submit a Pull Request.
80
+
81
+
## License
82
+
83
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
0 commit comments