Skip to main content

@superluminar-io/super-eks

Project description

:superhero_woman: super-eks

super-eks is a CDK construct that provides a preconfigured EKS installation with batteries included. Even when using best practices for your EKS cluster, picking the right setup can be overwhelming. super-eks solves this problem by making a few choices for you as outlined below.

:sparkles: Features

  • :white_check_mark: DNS management with external-dns
  • :white_check_mark: Forwarding logs to CloudWatch Logs with fluent-bit
  • :white_check_mark: Ingress management with the AWS Load Balancer Controller
  • :white_check_mark: Isolated node groups, one for the shipped components, the other one for your workloads
  • :white_check_mark: Hardened node setup, deny nodes altering the VPC setup.
  • :white_check_mark: Default to managed cluster add-ons where possible.

:world_map: Roadmap

  • :hammer_and_wrench: Monitoring with Prometheus and CloudWatch
  • :hammer_and_wrench: Backup solution for cluster recovery
  • :hammer_and_wrench: Authentication/authorization for workloads with Amazon Cognito
  • :hammer_and_wrench: Standalone one click Cloudformation installer without CDK
  • :hammer_and_wrench: Autoscaling for pods and cluster

:clapper: Quick Start

The quick start shows you how to setup a super-eks cluster.

Prerequisites

  • A working aws CLI installation with access to an account and administrator privileges
  • You'll need a recent NodeJS installation
  • kubectl to interact with your fresh cluster
  • An editor of your choice
  • Roughly 30 minutes of your time and a :coffee:, :tea: or :beverage_box:

To get going you'll need a CDK project. For details please refer to the detailed guide for CDK.

Create an empty directory on your system.

mkdir super-eks-setup && cd super-eks-setup

Bootstrap your CDK project, we will use TypeScript, but you can switch to any other supported language.

npx cdk init sample-app --language typescript
npx cdk bootstrap # Has to be done once for your AWS account

Now install the super-eks library.

npm i @superluminar-io/super-eks

You need to provide a Route53 Hosted zone and super-eks will take care of the rest.

npm i @aws-cdk/aws-route53

Paste the snippet into lib/super-eks-setup-stack.ts.

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.core as cdk
from aws_cdk.aws_route53 import HostedZone
from superluminar_io.super_eks import SuperEks

class SuperEksSetupStack(cdk.Stack):
    def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):
        super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)

        # Assumes you already have a Route53 zone in your account
        hosted_zone = HostedZone.from_lookup(self, "MyZone",
            domain_name="example.com"
        )

        # Setup super-eks
        super_eks = SuperEks(self, "hello-eks",
            hosted_zone=hosted_zone
        )

        # Add nginx installation for testing
        super_eks.cluster.add_helm_chart("nginx",
            create_namespace=True,
            namespace="nginx",
            repository="https://charts.bitnami.com/bitnami",
            chart="nginx",
            release="nginx",
            version="8.5.2",
            values={
                "ingress": {
                    "enabled": True,
                    "hostname": f"nginx.{hostedZone.zoneName}",
                    "annotations": {
                        "kubernetes.io/ingress.class": "alb",
                        "alb.ingress.kubernetes.io/scheme": "internet-facing",
                        "alb.ingress.kubernetes.io/target-type": "ip"
                    }
                }
            }
        )

Now deploy the stack.

npx cdk deploy

If everything works, you should see some output.

 ✅  IntegrationTestsStack

Outputs:
IntegrationTestsStack.EksClusterConfigCommandAEB22784 = aws eks update-kubeconfig --name EksCluster3394B24C-86f946f02a67416c80413e123d58b628 --region eu-central-1 --role-arn arn:aws:iam::123456789012:role/IntegrationTestsStack-EksClusterMastersRoleA746276-GNW143CGOXG7
IntegrationTestsStack.EksClusterGetTokenCommand53BD6035 = aws eks get-token --cluster-name EksCluster3394B24C-86f946f02a67416c80413e123d58b628 --region eu-central-1 --role-arn arn:aws:iam::123456789012:role/IntegrationTestsStack-EksClusterMastersRoleA746276-GNW143CGOXG7

Stack ARN:
arn:aws:cloudformation:eu-central-1:123456789012:stack/IntegrationTestsStack/06273460-660e-11eb-b4d9-06da4ef2f41a
✨  Done in 1757.52s.
✨  Done in 1757.79s.

Paste the aws eks update-kubeconfig command into your shell. This will update your kubeconfig.

aws eks update-kubeconfig --name EksCluster3394B24C-86f946f02a67416c80413e123d58b628 --region eu-central-1 --role-arn arn:aws:iam::123456789012:role/IntegrationTestsStack-EksClusterMastersRoleA746276-GNW143CGOXG7
Added new context arn:aws:eks:eu-central-1:123456789012:cluster/EksCluster3394B24C-86f946f02a67416c80413e123d58b628 to /home/super-eks/.kube/config

Now let's see if it works.

NAMESPACE      NAME                                            READY   STATUS    RESTARTS   AGE
dns            external-dns-7d4d69545d-r5w68                   1/1     Running   0          14m
logging        aws-for-fluent-bit-qwhwb                        1/1     Running   0          14m
logging        aws-for-fluent-bit-s7wnj                        1/1     Running   0          14m
ingress        aws-load-balancer-controller-5b9cbc5497-smfrt   1/1     Running   0          14m
kube-system    aws-node-lscgc                                  1/1     Running   0          18m
kube-system    aws-node-zfcdl                                  1/1     Running   0          18m
kube-system    coredns-59b69b4849-9gstn                        1/1     Running   0          25m
kube-system    coredns-59b69b4849-bssnr                        1/1     Running   0          25m
kube-system    kube-proxy-9sgtt                                1/1     Running   0          18m
kube-system    kube-proxy-r4gzg                                1/1     Running   0          18m
nginx          nginx-67cb444d48-lqzkg                          1/1     Running   0          14m

Voila! :tada: You now have a super EKS cluster with batteries included!

:open_book: API documentation

See the API documentation for details.

:gear: Development

:question: FAQ

Frequently asked questions are answered here.

What do you mean by "batteries included"?

Batteries included is a term that comes from the philosophy behind the Python programming language. It means, that super-eks ships with all necessary parts. You don't need additional things, like in this case Helm charts, manifests etc. apart from the workload you want to run on Kubernetes.

Why did you choose to include component X?

We try to include components, that are seen as community standards. On the other hand we choose components, that work best in combination with AWS.

Where are the advanced settings? I want to do things differently

super-eks makes some decisions for you. If you want an expert setup maybe super-eks isn't for you. If you believe core functionality is missing please open a GitHub issue.

I don't want to use CDK? Do you offer alternatives?

We are planning to release a standalone one click Cloudformation installer in the future.

:balance_scale: License

super-eks is distributed under the Apache License, Version 2.0.

See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superluminar-io.super-eks-0.2.5.tar.gz (36.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superluminar_io.super_eks-0.2.5-py3-none-any.whl (36.5 MB view details)

Uploaded Python 3

File details

Details for the file superluminar-io.super-eks-0.2.5.tar.gz.

File metadata

  • Download URL: superluminar-io.super-eks-0.2.5.tar.gz
  • Upload date:
  • Size: 36.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for superluminar-io.super-eks-0.2.5.tar.gz
Algorithm Hash digest
SHA256 c96ebeffd70993e4c74148eaab978e61dea9640fb7cd0f7316967586a2070ce1
MD5 451529103ceacc21201c6995e1bd897e
BLAKE2b-256 996272b72985777584c1f89bf0c5d3a4a75f1f2b9b039a37f89b8cc91b13c53c

See more details on using hashes here.

File details

Details for the file superluminar_io.super_eks-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: superluminar_io.super_eks-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 36.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for superluminar_io.super_eks-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 71edb48d0b8a8aaa610cfbb76b700f03a43c7f4520154cc5de12b3b6f4cde62d
MD5 91b7bf7aa7e6813ea6c5f3c631b99fb8
BLAKE2b-256 c50d42a6853ecf68698a3b5a36ccbc3b945330d9281a96c5dd89ee7451f22e72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page