Development

Development environments on Kubernetes

Creating development environments on Kubernetes has been a topic discussed many times. As teams increase the number of developers using Kubernetes, it continues to be a challenge for many developers.

This post aims to show how you can leverage Shipa to create environments and make them available to developers in just a few minutes!

Requirements

For you to follow along, you will need to have access to the following:

You can create a free account on Shipa Cloud, and for my setup, I will use an Oracle Kubernetes Engine (OKE) cluster. You are free to use other cluster providers.

Getting Started

Inviting Users

You can start by creating the different teams you want to use the environments you will provide them with using Shipa.

Creating teams is quick, and you should be able to do it by clicking on User Management and then Teams:

Adding teams

Once you create the teams you want to give access to, you can now click on Users and send out the invite to the developers you want to add to the platform:

Adding users

As you start inviting users to your Shipa Cloud account, you can assign them to the pre-created roles available, such as the Developer role.

Creating Environments

With your teams created and users invited, it’s now time to create the different environments for each team. For that, click on Frameworks.

Shipa uses the concept of Framework to create isolated environments inside your Kubernetes cluster. Shipa will create a dedicated namespace for each framework you create and connect to your cluster.

You can use frameworks to set policies you want to enforce to applications deployed using this framework automatically. You can go from the most basic policy to the most comprehensive or production-level one depending on the type of environment you are creating for your developer:

Creating frameworks

Shipa will guide you through defining the framework policies based on the selection above.

For a quick setup, I’m choosing the option “Deploy applications with reasonable defaults” and am creating two frameworks: project-environment1 and project-environment2

Framework / Environment 1
Framework / Environment 2

You can assign multiple teams to the same framework or create individual frameworks for each team.

Click on Create

Connecting a Cluster

Now its time to connect your frameworks to a cluster. Click on the Cluster menu option and then Add Cluster.

Connecting Cluster

You can enter the cluster name and the frameworks you want to connect to your cluster on the first screen.

When you click on Next, Shipa will require you to enter:

  • Your Kubernetes cluster IP
  • A service account token Shipa can use to deploy and manage applications for those frameworks
  • The CA certificate Shipa can use to connect to your cluster

You can find detailed information on creating a service account for Shipa and find the information above here. 
I have also created a cheat script and made it available here. If you download it and run it locally (assuming your kubectl is connected to your cluster), the script will create the service account and display the required information, so you just copy and paste it into the popup:

Connecting Cluster

The next step allows you to enter custom ingress controller information. This is useful in cases you already have an ingress controller installed in your cluster.

In my case, I just have a “raw” Kubernetes cluster and have not installed any ingress controllers, monitoring, so I don’t need to enter anything here. By not entering any ingress information, Shipa will automatically install and configure NGINX to be later used by the applications your developers deploy.

Connecting Cluster

The cluster connection step should take between 1 and 2 minutes. You can see its progress by clicking on the Events link on the left menu. Once the event is complete, a confirmation message will be displayed.

If you now run kubectl get namespace, you will see some new namespaces:

  • Shipa: used by Shipa to run its services in the connected cluster
  • Frameworks: As mentioned above, Shipa will create a new namespace for each framework you connect to a cluster, and later, applications your developers deploy using a framework will be deployed using its respective namespace.
Namespaces

That’s it! In just a few minutes, you have created a development environment for your teams and took a cluster from 0 to being application ready for your developers in no time.

Developer Time

Now its time for your developers to take advantage of the developer platform you just set up for them. Once they log into Shipa, they will be able to quickly deploy their applications without getting entangled with the underlying Kubernetes complexities. Ultimately, freeing you up and enabling a developer self-service model.

By clicking on Applications and then Create app, developers will see the following:

Creating Application

At this point, your developers won’t need to interact with Kubernetes anymore but rather will only see the frameworks (or environments) you make available to them. This approach enables you to quickly adopt new clusters, upgrade versions, and more without impacting the way developers deploy and manage their applications.

Once they click on Create and then click on their application name, they can easily deploy their application:

Deploying Application
Deploying Application

The application deployment will take just a few seconds. Developers will be able to access their applications by using the endpoint automatically created by Shipa

Conclusion

In just a few minutes, you can go from a raw cluster to an application-ready cluster, including an advanced Developer Portal.

This will enable you to focus on continually evolving your infrastructure while enabling a developer self-service model, all while keeping control of what and how applications are deployed across your clusters.

Resources