-
Notifications
You must be signed in to change notification settings - Fork 18
/
eks-cluster.yaml
174 lines (156 loc) · 5.47 KB
/
eks-cluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
# Template, please change
# Please make sure you also update the definition of the variable
# CLUSTERNAME=<cluster name> in the overrideBootstrapCommand section
# and k8s.io/cluster-autoscaler/<cluster name>: "owned"
# cluster-autoscaler will not be require additional labels in a future release.
# https://github.com/kubernetes/autoscaler/pull/3968
name: gitpod
# Template, please change
region: us-west-2
version: "1.21"
iam:
withOIDC: true
serviceAccounts:
- metadata:
name: aws-load-balancer-controller
namespace: kube-system
wellKnownPolicies:
awsLoadBalancerController: true
- metadata:
name: ebs-csi-controller-sa
namespace: kube-system
wellKnownPolicies:
ebsCSIController: true
- metadata:
name: cluster-autoscaler
namespace: kube-system
wellKnownPolicies:
autoScaler: true
availabilityZones:
- us-west-2a
- us-west-2b
- us-west-2c
# By default we create a dedicated VPC for the cluster
# You can use an existing VPC by supplying private and/or public subnets. Please check
# https://eksctl.io/usage/vpc-networking/#use-existing-vpc-other-custom-configuration
vpc:
autoAllocateIPv6: false
nat:
# For production environments user HighlyAvailable
# https://eksctl.io/usage/vpc-networking/#nat-gateway
gateway: Single
# Enable EKS control plane logging
# https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html
cloudWatch:
clusterLogging:
enableTypes: ["audit", "authenticator"]
privateCluster:
enabled: false
additionalEndpointServices:
- "autoscaling"
- "logs"
managedNodeGroups:
- name: workspaces
desiredCapacity: 1
minSize: 1
maxSize: 10
# because of AWS addons
disableIMDSv1: false
# Please configure the size of the volume and additional features
# https://eksctl.io/usage/schema/#nodeGroups-volumeType
# https://aws.amazon.com/es/ebs/pricing/
volumeSize: 300
volumeType: gp3
volumeIOPS: 6000
volumeThroughput: 500
ebsOptimized: true
# Use private subnets for nodes
# https://eksctl.io/usage/vpc-networking/#use-private-subnets-for-initial-nodegroup
privateNetworking: true
ami: ami-009935ddbb32a7f3c
tags:
# EC2 tags required for cluster-autoscaler auto-discovery
k8s.io/cluster-autoscaler/enabled: "true"
k8s.io/cluster-autoscaler/gitpod: "owned"
iam:
attachPolicyARNs: &attachPolicyARNs
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
- arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
- arn:aws:iam::aws:policy/ElasticLoadBalancingFullAccess
- arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
withAddonPolicies: &withAddonPolicies
albIngress: true
autoScaler: true
cloudWatch: true
certManager: true
ebs: true
# Using custom AMI images require the definition of overrideBootstrapCommand
# to ensure that nodes are able to join the cluster https://eksctl.io/usage/custom-ami-support/
overrideBootstrapCommand: |
#!/bin/bash
export CLUSTERNAME=gitpod
export NODEGROUP=workspaces
declare -a LABELS=(
eks.amazonaws.com/nodegroup="${NODEGROUP}"
gitpod.io/workload_workspace_services=true
gitpod.io/workload_workspace_regular=true
gitpod.io/workload_workspace_headless=true
)
export KUBELET_EXTRA_ARGS="$(printf -- "--max-pods=110 --node-labels=%s" $(IFS=$','; echo "${LABELS[*]}"))"
/etc/eks/bootstrap.sh ${CLUSTERNAME}
spot: false
# https://eksctl.io/usage/instance-selector/
#instanceSelector:
# vCPUs: 8
# memory: 64Gib
# or use a custom list
instanceTypes: ["m6i.xlarge", "m6i.2xlarge"]
- name: services
desiredCapacity: 1
minSize: 1
maxSize: 3
# because of AWS addons
disableIMDSv1: false
# Please configure the size of the volume and additional features
# https://eksctl.io/usage/schema/#nodeGroups-volumeType
# https://aws.amazon.com/es/ebs/pricing/
volumeSize: 100
volumeType: gp3
volumeIOPS: 6000
volumeThroughput: 500
ebsOptimized: true
# Use private subnets for nodes
# https://eksctl.io/usage/vpc-networking/#use-private-subnets-for-initial-nodegroup
privateNetworking: true
ami: ami-009935ddbb32a7f3c
tags:
# EC2 tags required for cluster-autoscaler auto-discovery
k8s.io/cluster-autoscaler/enabled: "true"
k8s.io/cluster-autoscaler/gitpod: "owned"
iam:
attachPolicyARNs: *attachPolicyARNs
withAddonPolicies: *withAddonPolicies
# Using custom AMI images require the definition of overrideBootstrapCommand
# to ensure that nodes are able to join the cluster https://eksctl.io/usage/custom-ami-support/
overrideBootstrapCommand: |
#!/bin/bash
export CLUSTERNAME=gitpod
export NODEGROUP=services
declare -a LABELS=(
eks.amazonaws.com/nodegroup="${NODEGROUP}"
gitpod.io/workload_meta=true
gitpod.io/workload_ide=true
)
export KUBELET_EXTRA_ARGS="$(printf -- "--max-pods=110 --node-labels=%s" $(IFS=$','; echo "${LABELS[*]}"))"
/etc/eks/bootstrap.sh ${CLUSTERNAME}
spot: false
# https://eksctl.io/usage/instance-selector/
#instanceSelector:
# vCPUs: 4
# memory: 16Gib
# or use a custom list
instanceTypes: ["m6i.xlarge", "m6i.2xlarge"]