Supergiant Blog

Product releases, new features, announcements, and tutorials.

How to Start Supergiant Server as a Service on Ubuntu

Posted by Brian Sage on November 7, 2016

By the end of this tutorial, you will have Supergiant running as a service using systemd on Ubuntu server 16.04 (really 15.04 and later).

To keep things simple, we will use Vagrant to stand up Ubuntu server, but if that doesn’t work for you, feel free to use whatever means you have available. It’s my hope to keep these instructions pretty simple and portable between AWS EC2, DigitalOceanOpenStack, VirtualBox, or anywhere else you can easily stand up an instance of the popular Ubuntu server. 

Running Supergiant as a Service

To reduce our cloud expenses, we created Supergiant to auto-scale hardware for our many Kubernetes clusters to reduce our cloud expenses. When computing needs go up, Supergiant ensures there is enough hardware to get the job done. When computing needs go down, Supergiant de-provisions nodes, greatly trimming costs.

In order to do this, we run Supergiant as a service, and this tutorial is designed to show you the fastest way to get there in as few steps as possible, so you can try it out, too.

Step 1: Ubuntu 16.04

Just in case you don’t have access to an Ubuntu 16.04 server, here is a quick way to use Vagrant and VirtualBox to stand one up locally. If you already have a test box, feel free to skip to the next step.

Install Vagrant and VirtualBox open-source applications, and then execute the following:

vagrant init gbarbieru/xenial

Edit the Vagrantfile to allow the new VM to receive an IP address from your router.

Vagrant.configure("2") do |config|
  ...
  config.vm.network "private_network", type: "dhcp"
  ...
end

Next, execute the following to startup (it might take a while to download Ubuntu your first time) and connect to your new Ubuntu server:

vagrant up && vagrant ssh

NOTE: Windows users may need to install ssh.exe in their system path.

Step 2: Get Supergiant

As of this tutorial, the most recent Supergiant release is 0.14.8, and that’s the version I’ve linked below. Always check the Supergiant latest release page for the current server binary URL.

Execute the following, which will download the Supergiant server binary to your /usr/sbin/ directory:

sudo curl https://github.com/supergiant/supergiant/releases/download/v0.14.8/supergiant-server-linux-amd64 -L -o /usr/bin/supergiant

Be sure to make the binary executable.

sudo chmod +x /usr/bin/supergiant

Step 3: Configure Supergiant

We will grab the example configuration file from github and put it in a responsible place. We don’t recommend using these default settings in production, but the configuration will work as-is for quick-start and testing purposes.

Execute the following to download the example configuration file:

sudo curl https://raw.githubusercontent.com/supergiant/supergiant/master/config/config.json.example --create-dirs -o /etc/supergiant/config.json

Use your favorite text editor to change the following configuration parameters in config.json to fit our Ubuntu environment:

{
  ...
  "sqlite_file": "/var/lib/supergiant/development.db",
  ...
  "log_file": "/var/log/supergiant/development.log",
  ...
}

Next create the directories we just referenced, so Supergiant can write its DB and log files:

sudo mkdir /var/lib/supergiant && sudo mkdir /var/log/supergiant

Next configure systemd to start Supergiant as a service. Use your favorite editor to create the following init file in /etc/systemd/system/supergiant.service:

[Unit]
Description=Supergiant Server
After=syslog.target
After=network.target
[Service]
ExecStart=/usr/bin/supergiant --config-file /etc/supergiant/config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target

Step 4: Create an Admin User

The first time Supergiant runs, an admin user will be created, and the service will output the username and password to the console.

Execute the following in the terminal to test your configuration and create your admin user:

sudo supergiant --config-file /etc/supergiant/config.json

Save the randomly generated password, so you can access the dashboard later. Type Control+C to stop the server after the user is created.

If you have any trouble by this point, please join us on our Slack channel.

Step 5: Start Your Supergiant Server

Start your new Supergiant system service like so:

sudo systemctl start supergiant.service

In this case, no news is good news. The system shouldn't produce any output if this is successful.

To check the status of the service, you may execute the following:

sudo systemctl status supergiant.service

Last, enable the service to start on bootup:

sudo systemctl enable supergiant.service

Access your Supergiant Dashboard

By default, Supergiant serves HTTP over port 8080, and Ubuntu’s simple firewall is off by default. To access the dashboard, simply get the IP of our server and then open it up in a web browser.

From within your Vagrant VM console type ifconfig and hit Enter. In the console output, it’s likely eth1 will be the IP address assigned by your router.

Put the IP, followed by the port number:8080 in a web browser to access your Supergiant dashboard on its default port (or whatever port you may have customized in your config.json file above), then use the username "admin" and the password generated above to log in.

That’s it!

You’ve successfully created a Supergiant server that runs as a service. For greater security, we recommend creating a new admin user, logging in as that user, and then deleting the account named "admin".

Access the Supergiant Community

Remember, if you have trouble, or if you want to talk to other users about how they're making the most of Supergiant, our community hangs out on the Supergiant public Slack channel.

We would love any feedback you want to leave. We're working hard to add features that our community wants most, so all your comments are helpful to us. Visit the Supergiant Slack channel, and post your questions and comments.

Whereto Next?

This tutorial is one in a series to help you get started with Kubernetes using Supergiant. From here we recommend you check out the following:

Keep reading

Auto-Scaling Kubernetes Cluster with OpenStack, Supergiant

Posted by Brian Sage on November 1, 2016

In this tutorial, we will show you how to use Supergiant to deploy an auto-scaling Kubernetes cluster on OpenStack.

OpenStack configurations can vary widely, so this tutorial is designed to make instructions as reproducible as possible across many OpenStack deployments; however, if you run into trouble, please join us on our Slack channel and ask any questions.

For This Tutorial, You Will Need:

  • A running Supergiant installation
  • OpenStack account credentials (as of OpenStack Newton):
    • Identity Endpoint URL (found under Project > Compute > Access & Security > API Access > Identity)
    • API Password (generated under Settings > API Password > Request API Password)
    • Project ID (found under Project > Compute > Access & Security > View Credentials > Project ID
    • User Name with full admin access to instances, networks, subnets, floating IPs, and routers
  • Kube parameters
    • Region where you want to deploy your Kubernetes cluster
    • An SSH public key for accessing your Kubernetes cluster
    • The ID of your OpenStack public gateway (found under Network > Network Topology > click the “World” > ID)

Note: This is an article in a series to help you get up and running quickly with Kubernetes on OpenStack using Supergiant. If Supergiant is not yet running, see Supergiant tutorials to get started.

Kubernetes on OpenStack Hardware that Auto-Scales for You

Containerization is the future; however, managing hardware for changing computing needs can still be tedious. OpenStack solves a lot of scaling problems for us, so we’re excited to release Supergiant provider drivers for OpenStack.

Now, OpenStack users can use Supergiant to install auto-scaling Kubernetes Kubes in almost no time. After these few steps, you will have a resource-efficient, auto-scaling Kubernetes cluster on OpenStack, too. Let’s get started.

Step 1: Log in to Supergiant

To log in to Supergiant, if you haven’t created a user, you will need the admin user and password you created on Supergiant first-run.

Step 2: Add Cloud Credentials

Click to visit the Cloud Accounts view, and click to create a new entry with the OpenStack credentials listed above.

Your OpenStack credentials will need full administrator access to instances, networks, subnets, floating IPs, and routers.

Enter the following, and click Create.

{
  "credentials": {
    "identity_endpoint": "YOUR IDENTITY ENDPOINT URL",
    "password": "YOUR PASSWORD",
    "tenant_id": "YOUR PROJECT ID",
    "username": "YOUR USER NAME"
  },
  "name": "WHATEVER CLEVER NAME YOU LIKE",
  "provider": "openstack"
}

After the cloud account is created, remember the name you’ve given it. You’ll use it in the next step. You can always look it up again in the Cloud Accounts dashboard view.

Step 3: Create a Kube

Click to go to the Kubes view, and click to create a Kube.

Some values will be pre-populated for you. Edit whatever you like, but be sure to edit or review the following entries:

  • "cloud_account_name": the name of the Cloud Account you created above
  • “master _node_size”: the instance size for your Kubernetes master; the value you enter here will depend on what options are available to your Supergiant config JSON file
  • "name": a name for your Kube that starts with a letter, limited to 12 characters, made of lowercase letters, numbers, and/or dashes (-)
  • "node_sizes": this is an array of sizes specified in the Supergiant config/config.json file.
  • "region": The region in your OpenStack configuration you would like to launch your Kubernetes cluster. Example: "RegionOne"
  • "ssh_pub_key": paste the public key that will be authorized to access the Kubernetes API
  • "public_gateway_id": the ID of the OpenStack gateway or router that Supergiant should use when creating a floating IP for your Kubernetes API -- NOTE: you may choose to omit this key:value from this configuration, but you will need to manually configure a way for Supergiant to see the Kubernetes API to enable auto-scaling.

My configuration looks like this:

{
  "cloud_account_name": "tutstack",
  "master_node_size": "m1.smaller",
  "name": "tutkube",
  "node_sizes": [
    "m1.smaller",
    "m1.small"
  ],
  "openstack_config": {
    "region": "RegionOne",
    "ssh_pub_key": "ssh-rsa XXXXXXXX--my id_rsa.pub contents--XXXXXXXX",
    "public_gateway_id": "PUBLIC GATEWAY ID"
  }
}

When your edits are complete, click Create.

Step 4: Watch Supergiant Go!

Supergiant will orchestrate provisioning of OpenStack services, including security settings, gateways/routers, and more. When it is finished, it will provision your Kube master and Kube minion instances and will display log output as it goes.

The longest wait time will be “waiting for Kubernetes” as you wait for the OpenStack instance to be provisioned. This could take 5 minutes or longer, depending on what instance types you have specified. Just be patient; your OpenStack is working very hard for you.

NOTE: If your Supergiant server lies outside your OpenStack public gateway and port 443 is closed to the public, you may receive errors from the Supergiant Capacity Service. This is normal, as it is a part of how Supergiant polls and auto-scales instances. Consult your network security policy regarding whether to open port 443 for Supergiant’s Capacity Service.

Access Kubernetes

Once the process completes, you may click on the Kube ID to get details. To verify Kubernetes is running, get the username, password, and master_public_ip from the Kube details.

From your terminal, enter the following:

curl --insecure https://USERNAME:PASSWORD@MASTER_PUBLIC_IP/api/v1/

You should see a JSON response describing the API. Congratulations -- you’ve just launched an auto-scaling Kubernetes cluster on OpenStack!

Teardown

In case you want to tear down your tutorial Kube, from the Supergiant dashboard, simply click to view Kubes, select the one you wish to delete, and then select Delete from the Actions menu.

It’s as simple as that. Supergiant will clean up after itself and remove all the associated services unique to the Kube.

Access the Supergiant Community

Remember, if you have trouble, or if you want to talk to other users about how they're making the most of Supergiant, our community hangs out on the Supergiant public Slack channel.

We would love any feedback you want to leave. We're working hard to add features that our community wants most, so all your comments are helpful to us. Visit the Supergiant Slack channel, and post your questions and comments.

Where To Next?

This tutorial is one in a series to help you get started with Kubernetes using Supergiant. From here we recommend you check out the following:

Keep reading

Stop By Our Booth at KubeCon!

Posted by Adam Vanderbush on October 20, 2016

Supergiant will join other containerization experts at KubeCon in Seattle to introduce their new open-source container orchestration system on November 8 - 9. KubeCon (a CNCF event) gathers leading Kubernetes technologists from multiple open source cloud native communities to further the education and advancement of Docker, Kubernetes, and Cloud Native architectures. The event is co-located with CloudNativeCon.

Supergiant is the first production-grade container orchestration system that makes it easy to manage auto-scaling, clustered, stateful datastores.

Keep reading

Auto-Scaling Kubernetes Cluster on AWS EC2 with Supergiant

Posted by Brian Sage on September 19, 2016

By the end of this very brief tutorial, you will successfully deploy a Kubernetes cluster using Supergiant on AWS EC2, and it won’t take long at all.

Your cloud hardware will auto-scale according to the parameters you set to keep costs as low as possible. AWS hardware usage rates apply.

Sound awesome? It is.

For This Tutorial, You Will Need:

Note: This is the second article in a series to help you get up and running quickly with Kubernetes using Supergiant. If Supergiant is not yet running, see our previous article: How to Install Supergiant Container Orchestration Engine on AWS EC2. This article has been updated for Supergiant 0.11.x.

 

Kubernetes that Auto-Scales for You

Administering container orchestration systems and cloud hardware can be tedious because computing needs change. For everyone. All the time.

We got tired of manually doing the same things over and over, so we created Supergiant’s packing algorithm to automatically handle the work of scaling up and scaling down. When you launch a Kube with Supergiant, the packing algorithm is already active, and there is nothing more you need to do to reap auto-scaling cost-saving benefits.

After these few steps, you will have an auto-scaling Kubernetes cluster, too. Let’s get started.

Step 1: Log in to Supergiant

To log in to Supergiant, if you haven’t created a user, you will need the generated admin password. To retrieve it, go to your AWS EC2 console and access the system log for your Supergiant server.


With the instance selected, click Actions > Instance Settings > Get System Log.


Find your Supergiant admin Username and Password near the bottom of the System Log.

Now that you have credentials, access the Supergiant dashboard using the public DNS address of your instance. This address will be shown in your EC2 console.

Log in with your admin Username and Password, and you will be taken to the Sessions view.


Welcome to the Supergiant dashboard! From the Sessions view, we can see that our session has been created, and we can see and administrate who else is logged in.

Step 2: Add Cloud Credentials

Click to visit the Cloud Accounts view, and click to create a new entry with an AWS access key and secret key with full administrator access.


Enter the following, and click Create.

{
    "credentials": {
        "access_key": "AWS ACCESS KEY",
        "secret_key": "AWS SECRET KEY"
    },
    "name": "ANY VALID JSON STRING",
    "provider": "aws"
}

After the cloud account is created, make a mental note of the Cloud Account ID that Supergiant assigns. You’ll use it in the next step.

Step 3: Create a Kube

Click to go to the Kubes view, and click to create a Kube.

You will be asked which cloud provider you prefer to use to create a Kube and its hardware. This tutorial contains examples for AWS; however, you may select any provider you like.

When you select a provider, the correct provider JSON syntax will be populated in the editor. There is nothing more happening in the background that that.


Some values will be pre-populated for you. Edit whatever you like, but be sure to edit or review the following entries:

  • "cloud_account_id": enter the ID number of the Cloud Account you created above. Since v0.11 "cloud_account_id" is replaced by "cloud_account_name". Enter the friendly name you gave your cloud account when you created it above.
  • “name”: enter a string that starts with a letter, limited to 12 characters, made of lowercase letters and numbers, and/or dashes (-).
    Note: On AWS, we recommend no dashes, as some AWS services can be finicky with dashes in certain places.
  • “node_sizes”: these are the AWS EC2 instance types Supergiant uses to provision new hardware while auto-scaling to meet demand, starting with the smallest size that fits your needs. We’ve had very reliable performance running Kubernetes on the M4 family of instances, so the list is pre-populated with M4 values. For a complete list, see AWS Instance Types.
  • “availability_zone”: AWS hardware availability changes depending on your account. At times, AWS will make some zones available to you, while some not. Supergiant can deploy a Kube to any zone available to you, so reference this knowledge article to discover which AWS Regions and AZs are available to you.
  • “region”: Must be updated to be compatible with your availability_zone choice. E.g., if availability_zone is us-west-2a, the region must be updated to us-west-2.

When your edits are complete, click Create.

Step 4: Watch Supergiant Go!

Supergiant will orchestrate the provisioning of AWS services, including security settings, load balancers, routing tables and more. Finally, it will provision your Kube master and Kube minion and will display log output as it does it.


The longest wait time will be “waiting for Kubernetes” as you wait for the EC2 instance to be provisioned and boot. This could take 5 minutes or longer, depending on what instance types you have selected. Just be patient. Your order is up next.

Any errors will also be displayed in the log as they happen. There is no need to refresh the browser window.

Access Kubernetes

Once the process completes, you may click on the Kube ID to get details. To verify Kubernetes is running, get the username, password, and master_public_ip from the Kube details.


From the Kube details view, get the username, password, and master_public_ip.

From your terminal, enter the following:

curl --insecure https://USERNAME:PASSWORD@MASTER_PUBLIC_IP/api/v1/

You should see a JSON response describing the API. Congratulations -- you’ve just launched an auto-scaling Kubernetes cluster!

Teardown

In case you want to tear down your tutorial Kube, simply click to view Kubes, select the one you wish to delete, and then select Delete from the Actions menu.

It’s as simple as that. Supergiant will clean up after itself and remove all the associated AWS services unique to the Kube.

Access the Supergiant Community

Remember, if you have trouble, or if you want to talk to other users about how they're making the most of Supergiant, our community hangs out on the Supergiant public Slack channel.

We would love any feedback you want to leave. We're working hard to add features that our community wants most, so all your comments are helpful to us. Visit our Slack channel, and post your questions and comments.

Where To Next?

This tutorial is one in a series to help you get started with Kubernetes using Supergiant. From here we recommend you check out the following:

Keep reading

Supergiant Announces Winners of Echo Drawing

Posted by Mark Brandon on August 31, 2016

The Supergiant team had a great time at the Linux Foundation’s LinuxCon and ContainerCon last week in Toronto. It was a special week for the Linux community, celebrating 25 years since Linus Torvalds sent an email missive requesting help on the kernel he had been developing, giving birth to the open-source movement. Torvalds himself stopped by the Supergiant booth.

Visitors to our booth were entered into a drawing to win an Amazon Echo. We had hoped to do this drawing at the event, but we didn’t actually get the list until after we got home. To show that everything was on the up and up, we recorded this video of Mark Brandon demonstrating the Echo and Alexa Voice Assistant before he randomly drew the names of the winners.

Supergiant Announces Winners of Echo Drawing

The two winners were John-Alan Simmons, CTO of Conference Cloud, and Salman Saidi from Intel.

Keep reading

How to Install Supergiant Container Orchestration Engine on AWS EC2

Posted by Brian Sage on August 22, 2016

The goal of this walkthrough is to help you provision Supergiant on an Amazon Web Services EC2 test server. By the end of this tutorial, you will be ready to deploy your first App on Supergiant. Supergiant is the easiest open-source container orchestration system to install and use. AWS hardware usage rates apply.

You won’t need to download any source code or binaries. We’ve packaged everything into an Amazon machine image for AWS; however, if you want to take a look at the source, it’s all on GitHub.



Prepare for Launch

Sign into your AWS console and prepare to launch a new EC2 instance through a series of wizarding steps.

Step 1

From the EC2 console, push the Launch Instance button, choose Community AMIs, and search for "supergiant". You should be able to find the latest stable Supergiant AMI release quickly.

Note: when we release new versions of Supergiant, the AMI ID will change and will be different for each region, but we will always release new AMIs under the name "Supergiant".


Search for the latest release of supergiant AMI, then press Select to choose your instance type.

Step 2

Supergiant creates a dashboard that helps you manage any number of Supergiant Kubernetes instances. We recommend a single m4.large instance to hold the latest version of Supergiant, but you can experiment with what works best for you. After you select your instance type, click Next: Configure Instance Details.


Select your instance  type, then click Next: Configure Instance Details.

Step 3

There’s nothing we need to change, here. You may select to change whatever you like, but the defaults are sensible enough. When you’ve made your changes (or not), click Review and Launch.


Configuring these settings are out of the scope of this tutorial. To simply get started, we can leave everything here, as-is. Click Review and Launch.

Step, er... 7

The wizard skips a few steps, but hey, today that works for us. We only need to change one thing we skipped over. We need to take a step back to allow HTTP and HTTPS traffic. Click Edit security groups on this screen.


Click Edit security groups to add rules to allow HTTP and HTTPS traffic.

Add Security

The Dashboard will listen for HTTP traffic on port 9090 when it's ready, so we need to click Add Rule to allow HTTP traffic to that port.

0.8.x UPDATE: The Dashboard now listens for HTTP traffic on port 80.

0.9.x UPDATE: For better security, Supergiant now creates a self-signed certificate and serves the dashboard over HTTPS on port 443.


Click Add Rule and make the Type HTTP and the Port Range 80. Click Add Rule one more time and make the Type HTTPS and the Port Range 443. I’ve changed the Source to My IP in this example. Click Review and Launch when done.

Review and Launch Supergiant

It’s time to launch. If you want to use tags to identify this EC2 server, now is the time to add them. When you’re emotionally prepared for all the excitement, click Launch, and you will be asked what key pair you wish to use. Select whatever option you prefer.

Review changes, add tags if you want them, and click Launch.

Access the Dashboard

To access the dashboard, we will need to access the server’s logs to get the randomly-generated dashboard password. From the Launch Status page, click on the server’s ID to go to the EC2 console with only your new instance visible in the list. With the instance selected, click Actions > Instance Settings > Get System Log and then find your Supergiant Login Info, close to the bottom of the log.


With the instance selected, click Actions > Instance Settings > Get System Log.


Find your Supergiant Login UserName and Password near the bottom of the System Log.

Use your instance’s public DNS or IP address to access it with a web browser on port 80, then use the UserName and Password from the System Log to authenticate. You're now ready to administrate Kube clusters using your Supergiant dashboard!

Access the Supergiant Community

Remember, if you have trouble, or if you want to talk to other users about how they're making the most of Supergiant, our community hangs out on the Supergiant public Slack channel.

We would love any feedback you want to leave. We're working hard to add features that our community wants most, so all your comments are helpful to us. Visit our Slack channel, and post your questions and comments.

Where-To Next?

This tutorial is first in a series to help you get started with Kubernetes using Supergiant. From here we recommend checking out the following tutorials:

Keep reading