Hello folks,
Let me quickly introduce you guys about Cyclops before we start.
What is Cyclops?
Cyclops is a web-based tool designed to simplify the containerization process of apps in Kubernetes. Cyclops gives as an intuitive web form where we can configure our app seamlessly and also it provides us a dashboard where we can view all our pods, deployments, services. Moreover, it provides us key metrics like cluster's performance, resource utilization and health. It helps us to onboard quickly without spending much time on configuring things.
GitHub Link: .
Now that Minikube is installed, let's start it!
minikube start
Now we need to install Cyclops into our cluster, to do that run below command:
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.8.2/install/cyclops-install.yaml
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.8.2/install/demo-templates.yaml
To access Cyclops outside of the cluster, run the below command:
kubectl port-forward svc/cyclops-ui 3000:3000 -n cyclops
Now when you hit localhost:3000 in your browser, it shows you
cyclops-ui!
Creating Microservices and Deploying to Cyclops
I have created a student service which communicates with library service using rest template
Dockerfile of student service is as below
CODEFROM openjdk:17-jdk-alpine
WORKDIR /studentService
COPY target/studentService-0.0.1-SNAPSHOT.jar studentService.jar
EXPOSE 8090
ENTRYPOINT ["java", "-jar", "studentService.jar"]
Dockerfile of library service is as below
CODEFROM openjdk:17-jdk-alpine
WORKDIR /libraryService
COPY target/libraryService-0.0.1-SNAPSHOT.jar libraryService.jar
EXPOSE 8090
ENTRYPOINT ["java", "-jar", "libraryService.jar"]
Now we will build the images of both the services by checking out to each service folder where Dockerfile is present:
CODEdocker build -t student-service .
docker build -t library-service .
Let's tag this images and push to docker hub!
CODEdocker tag student-service your-dockerhub-username/student-service:latest
docker tag library-service your-dockerhub-username/library-service:latest
docker push your-dockerhub-username/student-service:latest
docker push your-dockerhub-username/library-service:latest
To deploy this services we generally define Deployment and Service YAML files. But here Cyclops comes into play and does that for us. We just need to create modules and wait for it to be up and running!
Now that we deployed microservices to Cyclops, we should also be able to access them from our browser and to do that forward the ports!
CODEkubectl port-forward svc/student-service 8090:80
kubectl port-forward svc/library-service 8090:80
How I Contributed to Cyclops
Cyclops team has opened
After creating a modules, the module card shows repo and path link. Now, this when path link was clicked it used to take use to broken Github link by eating current page.
Solution:
I have made changes such that when path link is clicked it opens in a new tab. And also, broken path link was fixed by using resolvedVersion _in url if present, if not then by using _version _ else using _main.
SOCIAL SHARE CARD GENERATOR