Skip to content

Spring Boot with the usage of Kuberneres Java Client Api (Pods,Deployments,Service,Namespace)

Notifications You must be signed in to change notification settings

Rapter1990/kubernetesjavaclientapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Kubernetes Java Client Api Example

Main Information

📖 Information

  • This Spring Boot application showcases the integration of the Kubernetes Java Client API to manage Kubernetes resources efficiently.
  • The implemented features cover the processes of listing, creating, editing, and deleting the following Kubernetes resources:
    • Namespace
    • Pod
    • Service
    • Deployment

Explore Rest APIs

Method Url Description Request Body Header Valid Path Variable No Path Variable
GET /api/v1/kubernetes/deployments/listDeployments List Deployments
POST /api/v1/kubernetes/deployments/createDeployment Create Deployment CreateDeploymentRequest
PUT /api/v1/kubernetes/deployments/editDeployment Edit Deployment EditDeploymentRequest
DELETE /api/v1/kubernetes/deployments/deleteDeployment Delete Deployment DeleteDeploymentRequest
GET /api/v1/kubernetes/namespaces/listNamespaces List Namespaces
POST /api/v1/kubernetes/namespaces/createNamespace Create Namespace CreateNamespaceRequest
PUT /api/v1/kubernetes/namespaces/editNamespace Edit Namespace EditNamespaceRequest
DELETE /api/v1/kubernetes/namespaces/deleteNamespace Delete Namespace DeleteNamespaceRequest
GET /api/v1/kubernetes/pods/listPods List Pods
POST /api/v1/kubernetes/pods/createPod Create Pod CreatePodRequest
PUT /api/v1/kubernetes/pods/editPod Edit Pod EditPodRequest
DELETE /api/v1/kubernetes/pods/deletePod Delete Pod DeletePodRequest
GET /api/v1/kubernetes/services/listServices List Services
POST /api/v1/kubernetes/services/createService Create Service CreateServiceRequest
PUT /api/v1/kubernetes/services/editService Edit Service EditServiceRequest
DELETE /api/v1/kubernetes/services/deleteService Delete Service DeleteServiceRequest

Technologies


  • Java 17
  • Spring Boot 3.0
  • Restful API
  • Lombok
  • Maven
  • Junit5
  • Mockito
  • Integration Tests
  • Postman

Prerequisites to Run the App

1 ) Install minikube to access this link https://minikube.sigs.k8s.io/docs/start/

2 ) Open command prompt and install kubectl through this command shown below

    minikube kubectl --

3 ) Start minikube through this command shown below.

    minikube start

Maven Run

To build and run the application with Maven, please follow the directions shown below;

$ cd kubernetesjavaclientapi
$ mvn clean install
$ mvn spring-boot:run

Screenshots

Click here to show the screenshots of project

Figure 1

Figure 2

Figure 3

Contributors