Introduction
Kubernetes tin beryllium analyzable to manage, but pinch Cyclops, you tin deploy applications to Kubernetes successful conscionable a fewer clicks. Cyclops abstracts the complexity of Kubernetes, providing a reliable and customizable personification acquisition for your developers.
Running Cyclops connected DigitalOcean Managed Kubernetes offers respective benefits. You tin negociate your apps, databases, and networking, making Cyclops and Kubernetes the only devices your developers request to vessel applications and products.
In this tutorial, you will:
- Create a Kubernetes cluster connected DigitalOcean.
- Set up Cyclops.
- Deploy an exertion done Cyclops.
- Provision a database and link your exertion to it.
Once you complete the tutorial, you will person built a developer level wherever your developers tin deploy applications and proviso databases without the hassle of managing Kubernetes and the cloud. You tin besides widen Cyclops pinch your ain templates to screen much usage cases circumstantial to your applications and organization.
Prerequisites
To complete this tutorial, you will need:
- kubectl to negociate your Kubernetes cluster.
- DigitalOcean relationship pinch Kubernetes cluster deployed.
Step 1 - Create a Kubernetes cluster
To create a Kubernetes cluster connected DigitalOcean, sojourn https://cloud.digitalocean.com/kubernetes/clusters/new.
You tin travel the steps successful this guideline connected Setting up a Kubernetes Cluster connected DigitalOcean.
Here, you tin configure the region, the type of your cluster, and really galore nodes you will need. You tin time off each the options connected default.
Before clicking the Create cluster button, make judge you tick the Add database usability truthful you tin deploy databases later connected successful the tutorial.
You tin adhd a typical sanction to your Kubernetes cluster, past click the Create cluster and springiness it a mates of minutes until the Kubernetes cluster is afloat up.
Step 2 - Install Cyclops into your cluster
Now that your Kubernetes cluster is up and moving connected DigitalOcean, you tin inspect it by clicking connected it successful the Kubernetes cluster list.
Cyclops is portion of the DigitalOcean Kubernetes marketplace, truthful you tin instal it by going to the Marketplace tab and searching for Cyclops. You tin instal it by simply clicking the instal button, and everything Cyclops needs will beryllium installed into your Kubernetes cluster.
To entree the Cyclops UI, you will request to expose it extracurricular of the cluster. To do that, you will request to download the config record from the Overview tab by clicking the Download Config File button.
After you download the kubeconfig file, you tin configure your kubectl to entree your DO cluster by mounting the situation adaptable KUBECONFIG to constituent to your kubeconfig file:
export KUBECONFIG=~/Downloads/<name of your cluster>-kubeconfig.yamlYou tin now cheque if Cyclops is moving arsenic expected successful your cluster. You tin do it pinch the pursuing command:
kubectl get pods -n cyclopsWhich will person an output akin to this:
[secondary_label Output] NAME READY STATUS RESTARTS AGE cyclops-ctrl-5b8bf97fc8-mh6vw 1/1 Running 0 144m cyclops-ui-64c4cdd7f7-mzgqh 1/1 Running 0 144mOnce some pods are running, you tin larboard guardant Cyclops to entree it:
kubectl port-forward svc/cyclops-ui 3000:3000 -n cyclopsCyclops is now disposable connected http://localhost:3000/.
Step 3 - Deploy an app
Once you person your Cyclops ready, you tin deploy a brand-new exertion utilizing it. When you unfastened Cyclops (http://localhost:3000/), you tin create a caller app by clicking the Add module button.
Here, you tin take from a mates of templates to create your applications from. You tin adhd your ain templates to screen your usage cases whenever you want. You tin study much connected really to do that successful this charismatic archiving connected Cyclops Templates.
For the liking of the demo, you tin usage the app-template, which comes pinch a mates of fields you tin play with:
- General - you tin group the docker image you want to tally and the env variables
- Scaling - group the number of instances of your applications and really galore resources you need
- Networking - configure really your app tin beryllium accessed
As shown successful the image above, you tin group Expose to external, which will expose your app truthful you tin entree it extracurricular of your Kubernetes cluster.
You tin now click Deploy to bring your app to life.
After a mates of minutes, your exertion is up, and if you cheque your Service, you will find an IP reside wherever you tin entree your exertion (If the externalIP is saying pending, springiness it a infinitesimal to create a load balancer). Copy the IP and paste it into your browser.
Without getting into the intricacies of Kubernetes aliases DigitalOcean, you are now moving an exertion connected Kubernetes that anybody tin access, and you tin simply scale, update, aliases negociate it nevertheless you want.
Step 4 - Provision a database
If you are processing an application, it’s apt your app will request immoderate benignant of storage. DigitalOcean provides a bunch of managed databases you tin use.
You tin create a caller exertion connected DigitalOcean and link your exertion to it, each from the Cyclops UI.
In the aforesaid measurement you created your first app successful Cyclops, you tin proviso a database. From the templates, prime the mysql template, which is specifically made for the DigitalOcean database operator.
After you prime the size of the database and its region, you tin deed Deploy.
You tin now spot your caller database successful Cyclops, arsenic good arsenic successful DigitalOcean, astatine https://cloud.digitalocean.com/databases.
Usually, you would now request to fig retired the credentials of your database and make judge that your exertion tin entree it. However, the Database usability from DigitalOcean stored each of that info successful your Kubernetes cluster, and the template you utilized for the demo app tin reuse that information to link to your database without you having to manually grip secrets.
The app-template you utilized will equine each of the database credentials to your exertion via situation variables you tin usage successful your codification to entree the database. The only point you request to do is show Cyclops which database to link to.
You request to unfastened your my-demo-app successful Cyclops and click Edit. You conscionable request to populate the MySQL relationship information pinch the sanction of your MySQL lawsuit and the database you want to link to (defaultdb gets created automatically).
When you deed Deploy, your app will person each the credentials populated via env variables and your app tin entree the database you conscionable created.
You tin cheque that yourself by viewing the Kubernetes deployment done Cyclops and clicking the View Manifest. You will spot a pop-up model pinch your deployment configuration now containing the pursuing situation variables:
No secrets handling aliases copy-pasting stuff; time off it to DigitalOcean, Kubernetes, and Cyclops.
All of these templates tin beryllium extended to support different databases aliases different kinds of applications. It’s wholly up to you. This tutorial shows really Cyclops mixed pinch Kubernetes operators tin make developers powerfulness users erstwhile it comes to deploying without making them onboard to a ton of caller technologies.
Clean up
To delete each the resources, you will request to delete the Kubernetes cluster, the managed database, and the load balancer if you person exposed your exertion extracurricular of the cluster.
Am I a Platform Engineer now?
With the setup you conscionable created, you made a skeleton of a developer platform. You person enabled self-service for different developers truthful they tin proviso resources and deploy applications connected their ain to move faster.
You tin now grow connected this conception by creating much templates for different usage cases for your teams and play astir pinch different Kubernetes operators to get much flexibility.
Cyclops is open-source, truthful consciousness free to cheque its GitHub repository and time off a star! ⭐