Skip to content

Commit

Permalink
openscapes: add aws eks addon for ebs driver
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Feb 5, 2023
1 parent 2127b31 commit f6ea7dd
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions eksctl/openscapes.jsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// Exports an eksctl config file for carbonplan cluster
/*
This file is a jsonnet template of a eksctl's cluster configuration file,
that is used with the eksctl CLI to both update and initialize an AWS EKS
based cluster.
This file has in turn been generated from eksctl/template.jsonnet which is
relevant to compare with for changes over time.
To use jsonnet to generate an eksctl configuration file from this, do:
jsonnet openscapes.jsonnet > eksctl-config.yaml
References:
- https://eksctl.io/usage/schema/
*/
local ng = import "./libsonnet/nodegroup.jsonnet";

// place all cluster nodes here
Expand All @@ -21,27 +35,27 @@ local notebookNodes = [
{ instanceType: "m5.2xlarge" },
{ instanceType: "m5.8xlarge" },
];

// Node definitions for dask worker nodes. Config here is merged
// with our dask worker node definition, which uses spot instances.
// A `node.kubernetes.io/instance-type label is set to the name of the
// *first* item in instanceDistribution.instanceTypes, to match
// what we do with notebook nodes. Pods can request a particular
// kind of node with a nodeSelector
local daskNodes = [
// Node definitions for dask worker nodes. Config here is merged
// with our dask worker node definition, which uses spot instances.
// A `node.kubernetes.io/instance-type label is set to the name of the
// *first* item in instanceDistribution.instanceTypes, to match
// what we do with notebook nodes. Pods can request a particular
// kind of node with a nodeSelector
{ instancesDistribution+: { instanceTypes: ["m5.large"] }},
{ instancesDistribution+: { instanceTypes: ["m5.xlarge"] }},
{ instancesDistribution+: { instanceTypes: ["m5.2xlarge"] }},
{ instancesDistribution+: { instanceTypes: ["m5.8xlarge"] }},
];


{
apiVersion: 'eksctl.io/v1alpha5',
kind: 'ClusterConfig',
metadata+: {
name: "openscapeshub",
region: clusterRegion,
version: '1.21'
version: '1.24'
},
availabilityZones: masterAzs,
iam: {
Expand All @@ -57,9 +71,28 @@ local daskNodes = [
],
} for namespace in namespaces],
},
// If you add an addon to this config, run the create addon command.
//
// eksctl create addon --config-file=eksctl-config.yaml
//
addons: [
{
// aws-ebs-csi-driver ensures that our PVCs are bound to PVs that
// couple to AWS EBS based storage, without it expect to see pods
// mounting a PVC failing to schedule and PVC resources that are
// unbound.
//
// Related docs: https://docs.aws.amazon.com/eks/latest/userguide/managing-ebs-csi.html
//
name: 'aws-ebs-csi-driver',
wellKnownPolicies: {
ebsCSIController: true,
},
},
],
nodeGroups: [n + {clusterName:: $.metadata.name} for n in [
ng {
name: 'core-b',
name: 'core-a',
availabilityZones: [nodeAz],
ssh: {
publicKeyPath: 'ssh-keys/openscapes.key.pub'
Expand Down

0 comments on commit f6ea7dd

Please sign in to comment.