0.2.373 • Published 3 years ago

eks-spot-blocks v0.2.373

Weekly downloads
730
License
Apache-2.0
Repository
github
Last release
3 years ago

awscdk-jsii-template NPM version PyPI version Release

cdk-eks-spotblocks

cdk-eks-spotblocks is a JSII construct library for AWS CDK to provison Amazon EKS cluster with EC2 Spot Blocks for defined workloads with the advantages of ensured availability and considerable price reduction for your kubernetes workload.

npm.io

Features

  • support the upstream AWS CDK aws-eks construct libraries by extending its capabilities
  • addSpotFleet() to create your spot fleet for your cluster
  • define your blockDuration, validFrom and validUntil for fine-graned control
  • support any AWS commercial regions which has Amazon EKS and EC2 Spot Block support, including AWS China regions

Sample

import * as eksspot from 'eks-spot-blocks';
import * as cdk from '@aws-cdk/core';
import * as ec2 from '@aws-cdk/aws-ec2';

const clusterStack = new eksspot.EksSpotCluster(stack, 'Cluster', {
  clusterVersion: eks.KubernetesVersion.V1_16,
});

clusterStack.addSpotFleet('FirstFleet', {
  blockDuration: eksspot.BlockDuration.SIX_HOURS,
  targetCapacity: 1,
  defaultInstanceType: new ec2.InstanceType('p3.2xlarge'),
  validUntil: clusterStack.addHours(new Date(), 6).toISOString(),
  terminateInstancesWithExpiration: true
})

clusterStack.addSpotFleet('SecondFleet', {
  blockDuration: eksspot.BlockDuration.ONE_HOUR,
  targetCapacity: 2,
  defaultInstanceType: new ec2.InstanceType('c5.large'),
  validUntil: clusterStack.addHours(new Date(), 1).toISOString(),
  terminateInstancesWithExpiration: true
})

check eks-spot-blocks-demo for a full AWS CDK demo with this construct library.

Custom AMI support

const clusterStack = new EksSpotCluster(stack, 'Cluster', { 
  clusterVersion: eks.KubernetesVersion.V1_16,
  customAmiId: 'ami-xxxxxx'
});

FAQ

Does eks-spot-blocks support existing eks clusters created by eksctl, terraform or any other tools?

No. This construct library does not support existing Amazon EKS clusters. You have to create the cluster as well as the spot fleet altogether in this construct library.

Can I write the CDK in other languages like Python and Java?

Not at this moment. But we plan to publish this construct with JSII so we can install this library via npm, pypi, maven or nuget.

How much time can I block the spotfleet?

You can block the fleet with hourly increments up to 6 hours.

What happens after the blockDuration?

Spot Blocks ensure the availability of your spot instances during the blockDuration and avoid termination during the price disruption. After the blockDuration, by default, your spot instances will still be in running state but it doesn't ensure the availability, which means it might be terminated anytime after the blockDuration.

Can I terminate the fleet immediately after the blockDuration to save the money?

Yes. Basically you can configure validFrom, validUntil and terminateInstancesWithExpiration to achieve this.

However, consider the following scenario

<deploy start at 1:00>|--------(one hour)-----------------------|<2:00>
                           |<fleet created at 1:05>--------(one-hour block)-------|<2:05>

Your fleet will be terminated at 2:00 rather at 2:05.

Are tains and labels supported?

Yes.

(samples TBD)

Does it support AWS China regions?

Yes. Including Beijing(cn-north-1) and Ningxia(cn-northwest-1).

How much can I save from the EC2 Spot Block compared to the on-demand?

According to this document

Spot Instances are also available to run for a predefined duration – in hourly increments up to six hours in length – at a discount of up to 30-50% compared to On-Demand pricing.

Will this library become part of the upstream aws-eks construct library?

Probably. As it's still in the preliminary stage, we are still collecting feedbacks from the community to make eks-spot-blocks ready for production workloads. Eventually we will commit this feature to the upstream aws-eks construct library in AWS CDK through pull requests.

0.2.373

3 years ago

0.2.372

3 years ago

0.2.371

3 years ago

0.2.370

3 years ago

0.2.369

3 years ago

0.2.368

3 years ago

0.2.367

3 years ago

0.2.366

3 years ago

0.2.365

3 years ago

0.2.364

3 years ago

0.2.363

3 years ago

0.2.362

3 years ago

0.2.361

3 years ago

0.2.360

3 years ago

0.2.359

3 years ago

0.2.358

3 years ago

0.2.357

3 years ago

0.2.356

3 years ago

0.2.355

3 years ago

0.2.354

3 years ago

0.2.353

3 years ago

0.2.352

3 years ago

0.2.351

3 years ago

0.2.350

3 years ago

0.2.349

3 years ago

0.2.348

3 years ago

0.2.347

3 years ago

0.2.346

3 years ago

0.2.345

3 years ago

0.2.344

3 years ago

0.2.343

3 years ago

0.2.342

3 years ago

0.2.341

3 years ago

0.2.340

3 years ago

0.2.339

3 years ago

0.2.338

3 years ago

0.2.337

3 years ago

0.2.336

3 years ago

0.2.335

3 years ago

0.2.334

3 years ago

0.2.333

3 years ago

0.2.332

3 years ago

0.2.331

3 years ago

0.2.330

3 years ago

0.2.329

3 years ago

0.2.328

3 years ago

0.2.327

3 years ago

0.2.326

3 years ago

0.2.325

3 years ago

0.2.324

3 years ago

0.2.323

3 years ago

0.2.322

3 years ago

0.2.321

3 years ago

0.2.320

3 years ago

0.2.319

3 years ago

0.2.318

3 years ago

0.2.317

3 years ago

0.2.316

3 years ago

0.2.315

3 years ago

0.2.314

3 years ago

0.2.313

3 years ago

0.2.306

3 years ago

0.2.305

3 years ago

0.2.304

3 years ago

0.2.312

3 years ago

0.2.311

3 years ago

0.2.310

3 years ago

0.2.309

3 years ago

0.2.308

3 years ago

0.2.307

3 years ago

0.2.303

3 years ago

0.2.299

3 years ago

0.2.298

3 years ago

0.2.297

3 years ago

0.2.296

3 years ago

0.2.295

3 years ago

0.2.294

3 years ago

0.2.293

3 years ago

0.2.292

3 years ago

0.2.302

3 years ago

0.2.301

3 years ago

0.2.300

3 years ago

0.2.291

3 years ago

0.2.290

3 years ago

0.2.289

3 years ago

0.2.288

3 years ago

0.2.287

3 years ago

0.2.286

3 years ago

0.2.285

3 years ago

0.2.284

3 years ago

0.2.283

3 years ago

0.2.282

3 years ago

0.2.281

3 years ago

0.2.280

3 years ago

0.2.279

3 years ago

0.2.278

3 years ago

0.2.277

3 years ago

0.2.276

3 years ago

0.2.275

3 years ago

0.2.274

3 years ago

0.2.273

3 years ago

0.2.272

3 years ago

0.2.271

3 years ago

0.2.269

3 years ago

0.2.270

3 years ago

0.2.268

3 years ago

0.2.267

3 years ago

0.2.266

3 years ago

0.2.265

3 years ago

0.2.264

3 years ago

0.2.263

3 years ago

0.2.262

3 years ago

0.2.261

3 years ago

0.2.260

3 years ago

0.2.259

3 years ago

0.2.258

3 years ago

0.2.257

3 years ago

0.2.256

3 years ago

0.2.255

3 years ago

0.2.254

3 years ago

0.2.253

3 years ago

0.2.252

3 years ago

0.2.251

3 years ago

0.2.250

3 years ago

0.2.249

3 years ago

0.2.248

3 years ago

0.2.247

3 years ago

0.2.246

3 years ago

0.2.245

3 years ago

0.2.244

3 years ago

0.2.243

3 years ago

0.2.242

3 years ago

0.2.241

3 years ago

0.2.240

3 years ago

0.2.239

3 years ago

0.2.238

3 years ago

0.2.237

3 years ago

0.2.236

3 years ago

0.2.235

3 years ago

0.2.234

3 years ago

0.2.233

3 years ago

0.2.232

3 years ago

0.2.231

3 years ago

0.2.230

3 years ago

0.2.229

3 years ago

0.2.228

3 years ago

0.2.227

3 years ago

0.2.226

3 years ago

0.2.225

3 years ago

0.2.224

3 years ago

0.2.223

3 years ago

0.2.222

3 years ago

0.2.221

3 years ago

0.2.220

3 years ago

0.2.219

3 years ago

0.2.218

3 years ago

0.2.217

3 years ago

0.2.216

3 years ago

0.2.215

3 years ago

0.2.214

3 years ago

0.2.213

3 years ago

0.2.212

3 years ago

0.2.211

3 years ago

0.2.210

3 years ago

0.2.209

3 years ago

0.2.208

3 years ago

0.2.207

3 years ago

0.2.206

3 years ago

0.2.205

3 years ago

0.2.204

3 years ago

0.2.203

4 years ago

0.2.202

4 years ago

0.2.201

4 years ago

0.2.199

4 years ago

0.2.198

4 years ago

0.2.200

4 years ago

0.2.197

4 years ago

0.2.196

4 years ago

0.2.195

4 years ago

0.2.194

4 years ago

0.2.193

4 years ago

0.2.192

4 years ago

0.2.191

4 years ago

0.2.190

4 years ago

0.2.189

4 years ago

0.2.188

4 years ago

0.2.187

4 years ago

0.2.186

4 years ago

0.2.185

4 years ago

0.2.184

4 years ago

0.2.183

4 years ago

0.2.182

4 years ago

0.2.181

4 years ago

0.2.180

4 years ago

0.2.179

4 years ago

0.2.178

4 years ago

0.2.177

4 years ago

0.2.176

4 years ago

0.2.175

4 years ago

0.2.174

4 years ago

0.2.173

4 years ago

0.2.172

4 years ago

0.2.171

4 years ago

0.2.170

4 years ago

0.2.169

4 years ago

0.2.168

4 years ago

0.2.167

4 years ago

0.2.166

4 years ago

0.2.165

4 years ago

0.2.164

4 years ago

0.2.163

4 years ago

0.2.162

4 years ago

0.2.161

4 years ago

0.2.160

4 years ago

0.2.159

4 years ago

0.2.158

4 years ago

0.2.157

4 years ago

0.2.156

4 years ago

0.2.155

4 years ago

0.2.154

4 years ago

0.2.153

4 years ago

0.2.152

4 years ago

0.2.151

4 years ago

0.2.150

4 years ago

0.2.149

4 years ago

0.2.148

4 years ago

0.2.147

4 years ago

0.2.146

4 years ago

0.2.145

4 years ago

0.2.144

4 years ago

0.2.143

4 years ago

0.2.142

4 years ago

0.2.141

4 years ago

0.2.140

4 years ago

0.2.139

4 years ago

0.2.138

4 years ago

0.2.137

4 years ago

0.2.136

4 years ago

0.2.135

4 years ago

0.2.134

4 years ago

0.2.133

4 years ago

0.2.132

4 years ago

0.2.131

4 years ago

0.2.130

4 years ago

0.2.129

4 years ago

0.2.128

4 years ago

0.2.127

4 years ago

0.2.126

4 years ago

0.2.125

4 years ago

0.2.124

4 years ago

0.2.123

4 years ago

0.2.122

4 years ago

0.2.121

4 years ago

0.2.120

4 years ago

0.2.119

4 years ago

0.2.118

4 years ago

0.2.117

4 years ago

0.2.116

4 years ago

0.2.115

4 years ago

0.2.114

4 years ago

0.2.113

4 years ago

0.2.112

4 years ago

0.2.111

4 years ago

0.2.110

4 years ago

0.2.109

4 years ago

0.2.108

4 years ago

0.2.107

4 years ago

0.2.106

4 years ago

0.2.105

4 years ago

0.2.104

4 years ago

0.2.103

4 years ago

0.2.102

4 years ago

0.2.101

4 years ago

0.2.100

4 years ago

0.2.99

4 years ago

0.2.98

4 years ago

0.2.97

4 years ago

0.2.96

4 years ago

0.2.95

4 years ago

0.2.94

4 years ago

0.2.93

4 years ago

0.2.92

4 years ago

0.2.91

4 years ago

0.2.90

4 years ago

0.2.89

4 years ago

0.2.88

4 years ago

0.2.87

4 years ago

0.2.85

4 years ago

0.2.86

4 years ago

0.2.84

4 years ago

0.2.83

4 years ago

0.2.82

4 years ago

0.2.81

4 years ago

0.2.80

4 years ago

0.2.79

4 years ago

0.2.78

4 years ago

0.2.77

4 years ago

0.2.76

4 years ago

0.2.75

4 years ago

0.2.74

4 years ago

0.2.73

4 years ago

0.2.72

4 years ago

0.2.71

4 years ago

0.2.70

4 years ago

0.2.69

4 years ago

0.2.68

4 years ago

0.2.67

4 years ago

0.2.66

4 years ago

0.2.65

4 years ago

0.2.64

4 years ago

0.2.63

4 years ago

0.2.62

4 years ago

0.2.61

4 years ago

0.2.60

4 years ago

0.2.59

4 years ago

0.2.58

4 years ago

0.2.57

4 years ago

0.2.56

4 years ago

0.2.52

4 years ago

0.2.51

4 years ago

0.2.50

4 years ago

0.2.55

4 years ago

0.2.54

4 years ago

0.2.53

4 years ago

0.2.41

4 years ago

0.2.40

4 years ago

0.2.49

4 years ago

0.2.48

4 years ago

0.2.47

4 years ago

0.2.46

4 years ago

0.2.45

4 years ago

0.2.44

4 years ago

0.2.43

4 years ago

0.2.42

4 years ago

0.2.39

4 years ago

0.2.38

4 years ago

0.2.37

4 years ago

0.2.36

4 years ago

0.2.35

4 years ago

0.2.34

4 years ago

0.2.33

4 years ago

0.2.32

4 years ago

0.2.31

4 years ago

0.2.30

4 years ago

0.2.29

4 years ago

0.2.28

4 years ago

0.2.27

4 years ago

0.2.26

4 years ago

0.2.25

4 years ago

0.2.24

4 years ago

0.2.23

4 years ago

0.2.22

4 years ago

0.2.21

4 years ago

0.2.19

4 years ago

0.2.18

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.15

4 years ago

0.2.14

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.0.0

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago