Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oguzhan Yilmaz committed Nov 5, 2023
1 parent 30bffe0 commit 24dac5a
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 41 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ This repo uses [eksdemo](https://github.com/awslabs/eksdemo) to create an EKS Cl

## Index

- [EKS Custom Networking: VPC with Secondary CIDR](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/eks-custom-networking-vpc-secondary-cidr)
- [Karpenter Configuration](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/karpenter)
- [Create Load](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/create-load)
- [Troubleshooting](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/troubleshooting)
- [EC2 Instance Selector](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/ec2-instance-selector)
- [Create Debug Container](https://oguzhan-yilmaz.github.io/karpenter-eks-vpc-secondary-cidr/create-debug-container)
- **Demo: AWS VPC CNI Custom Networking**
- [About the Demo](eksdemo-secondary-cidr-and-cni-custom-netwoking/README.md)
- [1. Create VPC with Secondary CIDR and Subnets]()
- [2. AWS VPC CNI & ENIConfig configuration for Custom Networking](eksdemo-secondary-cidr-and-cni-custom-netwoking/2-aws-vpc-cni-configuration.md)
- [3. Karpenter v1alpha Configuration](eksdemo-secondary-cidr-and-cni-custom-netwoking/3-karpenter-v1alpha-configuration.md)
- [Demo Troubleshooting](eksdemo-secondary-cidr-and-cni-custom-netwoking/troubleshooting.md)
- [ec2-instance-selector CLI tool](ec2-instance-selector.md)





Expand Down
16 changes: 8 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

## Index

TODO: fix index

- [EKS Custom Networking: VPC with Secondary CIDR](eks-custom-networking-vpc-secondary-cidr.md)
- [Karpenter Configuration](karpenter-configuration-pre-v0-31.md)
- [EC2 Instance Selector](ec2-instance-selector.md)
- **Demo: AWS VPC CNI Custom Networking**
- [About the Demo](eksdemo-secondary-cidr-and-cni-custom-netwoking/README.md)
- [1. Create VPC with Secondary CIDR and Subnets]()
- [2. AWS VPC CNI & ENIConfig configuration for Custom Networking](eksdemo-secondary-cidr-and-cni-custom-netwoking/2-aws-vpc-cni-configuration.md)
- [3. Karpenter v1alpha Configuration](eksdemo-secondary-cidr-and-cni-custom-netwoking/3-karpenter-v1alpha-configuration.md)
- [Demo Troubleshooting](eksdemo-secondary-cidr-and-cni-custom-netwoking/troubleshooting.md)
- [ec2-instance-selector CLI tool](ec2-instance-selector.md)



## ENI Custom Networking Demo
Expand All @@ -25,7 +29,3 @@ TODO: fix index

![AWS CNI and ENIConfig Diagram](images/secondary-cidr-block-diagram.png)


## General Notes

-
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export AWS_PAGER="" # disable the aws cli pager
export AWS_PROFILE=hepapi
export AWS_REGION=eu-central-1
export CLUSTER_NAME="tenten" # will be created with eksdemo tool
export CLUSTER_NAME="miyazaki" # will be created with eksdemo tool
export CLUSTER_VPC_CIDR="194.151.0.0/16" # main EKS Cluster VPC CIDR
export SECONDARY_CIDR_BLOCK="122.64.0.0/16" # secondary CIDR block, will be used for pod IPs
export AZ1_CIDR="122.64.0.0/19" # -> make sure to
Expand All @@ -28,7 +28,7 @@ export NODEGROUP_NAME="main" # default is 'main', keep this valu
# change the k8s version if you want to
eksdemo create cluster "$CLUSTER_NAME" \
--instance "m5.large" \
--nodes 1 \
--nodes 2 \
--version "1.24" \
--os "AmazonLinux2" \
--vpc-cidr "$CLUSTER_VPC_CIDR"
Expand Down
38 changes: 36 additions & 2 deletions docs/karpenter-v1beta-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh
- https://github.com/awslabs/amazon-eks-ami/blob/master/log-collector-script/linux/README.md
- collect logs of userdata + kubelet???










## Installation

```bash title="Export env. variables we will use in this demo"
Expand All @@ -14,7 +23,23 @@ export K8S_VERSION=1.24
export AWS_PAGER="" # disable the aws cli pager
export AWS_PROFILE=hepapi
export AWS_REGION=eu-central-1
export CLUSTER_NAME="bambi" # will be created with eksctl
export CLUSTER_NAME="miyazaki" # will be created with eksctl
```

### new one
```bash title="Export env. variables we will use in this demo"

eksdemo create cluster "$CLUSTER_NAME" \
--instance "m5.large" \
--nodes 2 \
--version "$K8S_VERSION" \
--os "AmazonLinux2"


eksdemo install autoscaling-karpenter \
--cluster "$CLUSTER_NAME" \
--version "$KARPENTER_VERSION" \
--set "hostNetwork=true,"
```

### Create an EKS cluster with Karpenter
Expand Down Expand Up @@ -80,10 +105,19 @@ aws sqs get-queue-attributes \
--attribute-names ApproximateNumberOfMessages --no-cli-pager --query 'Attributes'
```

### Create

```bash title=""



```


### Scale up the cluster

```bash title="Scale up the cluster"



```
```
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
## Index
-


https://karpenter.sh/docs/upgrading/v1beta1-migration/
```bash
export CLUSTER_NAME="bambi"
kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.32.1/pkg/apis/crds/karpenter.sh_nodepools.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.32.1/pkg/apis/crds/karpenter.sh_nodeclaims.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/karpenter/v0.32.1/pkg/apis/crds/karpenter.k8s.aws_ec2nodeclasses.yaml


cd examples/v1beta
envsubst < provisioner/spot.yaml

envsubst < examples/v1beta/node-pool.yaml | tee | kubectl apply -f -
envsubst < examples/v1beta/ec2-node-class.yaml | tee | kubectl apply -f -
envsubst < examples/v1beta/node-pool.yaml | kubectl apply -f -
envsubst < examples/v1beta/ec2-node-class.yaml | kubectl apply -f -



Expand Down
26 changes: 13 additions & 13 deletions examples/v1beta/node-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,21 @@ spec:
# Disruption section which describes the ways in which Karpenter can disrupt and replace Nodes
# Configuration in this section constrains how aggressive Karpenter can be with performing operations
# like rolling Nodes due to them hitting their maximum lifetime (expiry) or scaling down nodes to reduce cluster cost
disruption:
# Describes which types of Nodes Karpenter should consider for consolidation
# If using 'WhenUnderutilized', Karpenter will consider all nodes for consolidation and attempt to remove or replace Nodes when it discovers that the Node is underutilized and could be changed to reduce cost
# If using `WhenEmpty`, Karpenter will only consider nodes for consolidation that contain no workload pods
consolidationPolicy: WhenUnderutilized
# disruption:
# # Describes which types of Nodes Karpenter should consider for consolidation
# # If using 'WhenUnderutilized', Karpenter will consider all nodes for consolidation and attempt to remove or replace Nodes when it discovers that the Node is underutilized and could be changed to reduce cost
# # If using `WhenEmpty`, Karpenter will only consider nodes for consolidation that contain no workload pods
# consolidationPolicy: WhenUnderutilized

# The amount of time Karpenter should wait after discovering a consolidation decision
# This value can currently only be set when the consolidationPolicy is 'WhenEmpty'
# You can choose to disable consolidation entirely by setting the string value 'Never' here
consolidateAfter: 60s
# # The amount of time Karpenter should wait after discovering a consolidation decision
# # This value can currently only be set when the consolidationPolicy is 'WhenEmpty'
# # You can choose to disable consolidation entirely by setting the string value 'Never' here
# consolidateAfter: 60s

# The amount of time a Node can live on the cluster before being removed
# Avoiding long-running Nodes helps to reduce security vulnerabilities as well as to reduce the chance of issues that can plague Nodes with long uptimes such as file fragmentation or memory leaks from system processes
# You can choose to disable expiration entirely by setting the string value 'Never' here
expireAfter: 720h
# # The amount of time a Node can live on the cluster before being removed
# # Avoiding long-running Nodes helps to reduce security vulnerabilities as well as to reduce the chance of issues that can plague Nodes with long uptimes such as file fragmentation or memory leaks from system processes
# # You can choose to disable expiration entirely by setting the string value 'Never' here
# expireAfter: 720h

# Resource limits constrain the total size of the cluster.
# Limits prevent Karpenter from creating new instances once the limit is exceeded.
Expand Down
8 changes: 4 additions & 4 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ repo_name: oguzhan-yilmaz/karpenter-eks-vpc-secondary-cidr

nav:
- Home: README.md
- "Karpenter v1beta (v0.32+)": karpenter-v1beta-configuration.md
- "Karpenter v1alpha -> v1beta1 migration": migrate-from-awsnodetemplate-to-nodeclass.md
- "Multi NodeClass Strategy": multi-nodeclass-strategy.md
- "Demo: CNI Custom Networking":
# - "Karpenter v1beta (v0.32+)": karpenter-v1beta-configuration.md
# - "Karpenter v1alpha -> v1beta1 migration": migrate-from-awsnodetemplate-to-nodeclass.md
# - "Multi NodeClass Strategy": multi-nodeclass-strategy.md
- "Demo: AWS VPC CNI Custom Networking":
- "About the Demo": eksdemo-secondary-cidr-and-cni-custom-netwoking/README.md
- "1. Create VPC with Secondary CIDR and Subnets": eksdemo-secondary-cidr-and-cni-custom-netwoking/1-vpc-secondary-cidr-and-subnets.md
- "2. AWS VPC CNI & ENIConfig configuration for Custom Networking": eksdemo-secondary-cidr-and-cni-custom-netwoking/2-aws-vpc-cni-configuration.md
Expand Down

0 comments on commit 24dac5a

Please sign in to comment.