Skip to main content

Astrobase.

Project description

Astrobase

Astrobase; simple multi-cloud Kubernetes cluster management.

Test publish Coverage Package version


Documentation: https://docs.astrobase.cloud

Source Code: https://github.com/astrobase/astrobase


Astrobase is for developers that want to create and manage Kubernetes clusters across cloud providers.

The key features are:

  • API First: Unlike most other infrastructure management tools, Astrobase is an API-First service; meaning you can write any client code you like to create your Kubernetes clusters.
  • Kubernetes First: Astrobase only supports Kubernetes so you and your team can focus on streamlining the same application deployment story across any provider envrionment you might need to run your applications on.
  • Easy to use: Cluster creation definitions are short and simple, and you don't have to spend hours learning a domain specific language or think about a new resource management lifecycle. Astrobase only does what cloud providers do.
  • Start simple: Astrobase's simplest example takes about 5 minutes to complete.
  • Scale across clouds: If you're using Astrobase, and shipping your software to customers that use different cloud providers, you can test your deployments seamlessly and take advantage of over $300,000 in cloud provider credits while doing so.

Requirements

Python 3.7+

Alternatively, you can run Astrobase as a docker container incase you arent using python.

Installation

pip install astrobasecloud

A Quick Example

The absolute minimum

Create a file gke-cluster.yaml that contains the following content.

---
cluster:
  name: astrobase-quickstart
  provider: gcp
  location: us-central1-c
  node_pools:
    - name: default
      initial_node_count: 1
      autoscaling:
        enabled: true
        min_node_count: 1
        max_node_count: 3

Create a project on Google Cloud and link a billing account to the new project.

PROJECT_ID=ab-quickstart-$(date +%s)
gcloud projects create ab-quickstart-$(date +%s)
gcloud config set project $PROJECT_ID

Deploy

Start the astrobase server in one terminal session

astrobase server

Create your first profile. A profile points your cli to a particular astrobase server.

astrobase profile create local --no-secure \
export ASTROBASE_PROFILE=local

In another session, setup your GCP project and deploy your cluster!

astrobase provider setup gcp \
--project-id $(gcloud config get-value project) \
--service-name "container.googleapis.com"
astrobase cluster gke create \
--project-id $(gcloud config get-value project) \
--file "gke-cluster.yaml"

Done!

Download your credentials and make a request to the cluster once it's in a ready state

gcloud container clusters \
get-credentials astrobase-quickstart \
--zone us-central1-c && \
kubectl get nodes

Now it's time to clean-up.

astrobase cluster gke delete \
--project-id $(gcloud config get-value project) \
--file "gke-cluster.yaml"
gcloud projects delete $PROJECT_ID

Going Multi-Cloud

Two clusters, different clouds

Let's see what it takes to deploy onto two environments using Astrobase. Let's use GCP and AWS for this example.

Create a file gke-cluster.yaml with:

---
cluster:
  name: astrobase-quickstart
  provider: gcp
  location: us-central1-c
  node_pools:
    - name: default
      initial_node_count: 1
      autoscaling:
        enabled: true
        min_node_count: 1
        max_node_count: 3

Now create a file eks-cluster.yaml with:

---
cluster:
  name: astrobase-quickstart
  provider: eks
  region: us-east-1
  nodegroups:
    - nodegroupName: default
      scalingConfig:
        desiredSize: 1
        minSize: 1
        maxSize: 3

Deploy

Start the astrobase server in one terminal session

astrobase server

In another session, setup your GCP project and deploy your cluster!

astrobase provider setup gcp \
--project-id $(gcloud config get-value project) \
--service-name "container.googleapis.com"
astrobase cluster gke create \
--project-id $(gcloud config get-value project) \
--file "gke-cluster.yaml"

Then deploy your AWS EKS cluster!

astrobase cluster eks create \
--kubernetes-control-plane-arn=$(aws iam list-roles | jq -r '.Roles[] | select(.RoleName == "AstrobaseEKSRole") | .Arn') \
--cluster-subnet-id=$(aws ec2 describe-subnets --query 'Subnets[].SubnetId[]' | jq -r '.[0]') \
--cluster-subnet-id=$(aws ec2 describe-subnets --query 'Subnets[].SubnetId[]' | jq -r '.[1]') \
--cluster-security-group-id=$(aws ec2 describe-security-groups --query 'SecurityGroups[].GroupId' | jq -r '.[0]') \
--nodegroup-noderole-mapping="default=$(aws iam list-roles | jq -r '.Roles[] | select(.RoleName == "AstrobaseEKSNodegroupRole") | .Arn')" \
--file "eks-cluster.yaml"

Deploying your EKS cluster requires a little extra setup. Checkout the AWS user guide section for more details.

Now it's time to clean-up.

astrobase cluster gke delete \
--project-id $(gcloud config get-value project) \
--file "gke-cluster.yaml"
astrobase cluster eks delete \
--kubernetes-control-plane-arn=$(aws iam list-roles | jq -r '.Roles[] | select(.RoleName == "AstrobaseEKSRole") | .Arn') \
--cluster-subnet-id=$(aws ec2 describe-subnets --query 'Subnets[].SubnetId[]' | jq -r '.[0]') \
--cluster-subnet-id=$(aws ec2 describe-subnets --query 'Subnets[].SubnetId[]' | jq -r '.[1]') \
--cluster-security-group-id=$(aws ec2 describe-security-groups --query 'SecurityGroups[].GroupId' | jq -r '.[0]') \
--nodegroup-noderole-mapping="default=$(aws iam list-roles | jq -r '.Roles[] | select(.RoleName == "AstrobaseEKSNodegroupRole") | .Arn')" \
--file "eks-cluster.yaml"

Recap

In summary, Astrobase makes it incredibly simple to create multiple kubernetes environments in different cloud providers.

You don't have to learn a new language, you can extend the api if you need, deploy Astrobase into your cloud architecture, or simply run it locally.

For a more complete example including more features and detail, continue reading the user guide.

License

This project is licensed under the Apache 2.0 License.

Download files

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

Source Distribution

astrobasecloud-0.2.0a2.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

astrobasecloud-0.2.0a2-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file astrobasecloud-0.2.0a2.tar.gz.

File metadata

  • Download URL: astrobasecloud-0.2.0a2.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for astrobasecloud-0.2.0a2.tar.gz
Algorithm Hash digest
SHA256 235567aec8137a6e540c0ebf5c4a3c7a56e4bce66574079dc4246ceffeeadaa9
MD5 ce2a473804613e9d1f7f8ccfcb698ae8
BLAKE2b-256 3de6e51b4f932ce2ec6a3ec915bf2298281ae60339067b7cefa51b7bca565cc9

See more details on using hashes here.

File details

Details for the file astrobasecloud-0.2.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for astrobasecloud-0.2.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 8fe3bb85a99ef351ef91970f3bb59c79842cd76ba6e166a582cbd37dee6ecac5
MD5 efd8e1f9d60d488e11b93ecf84c7a15b
BLAKE2b-256 e567c2c8ab93992e157a60455856491c1da71f0298345410e8107af86e60a6ff

See more details on using hashes here.

Supported by

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