|
1 | 1 | # Kubernetes Operator Api |
2 | 2 |
|
3 | | -* We have created a sample Kubernetes operator API using the Java Kubernetes Client. <br> |
4 | | - The following are the flows that we have implemented in this project. |
5 | | - |
6 | | - ### 1-) Create deployment flow |
7 | | - - Deploy master |
8 | | - - Roll out status |
9 | | - - Deploy worker |
10 | | - - Roll out status |
11 | | - - Create service |
12 | | - - Create service ui |
13 | | - - Print pod status |
14 | | - - Retrieve service list |
15 | | - - Print service status |
16 | | - |
17 | | - ### 2-) Scale deployment flow |
18 | | - - Scale deployment |
19 | | - - Roll out status |
20 | | - |
21 | | - ### 3-) Terminate deployment flow |
22 | | - - Delete master deployment |
23 | | - - Delete worker deployment |
24 | | - - Delete master service |
25 | | - - Delete master ui service |
| 3 | +The Kubernetes API is a sample Kubernetes operator API using the <strong>Java Kubernetes Client</strong>.<br> |
| 4 | +The API is designed for <strong>master-worker</strong> deployment to satisfy the requirements. |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +* The <strong>CI/CD</strong> tool we used before this API started to not be enough. <br> |
| 9 | + The reasons why it is not enough are: |
| 10 | + - Deployments take too long to create, scale, and terminate. |
| 11 | + - In synchronous requests, some of the scenarios' statuses were pending or failed. |
| 12 | + - The pending scenarios could not be retried. |
| 13 | + - Rollbacks could not be performed automatically. |
| 14 | + - Since there was a strict structure to the deployment process, we could not do the business development at any stage. |
| 15 | + |
| 16 | + By using this API, above problems have been solved. You can use this API for such requirements. <br> |
| 17 | + |
| 18 | +* In the <i>resources</i> folder of our application we have: <br> |
| 19 | + <strong>master-deployment.yaml, worker-deployment.yaml, master-service.yaml, master-service-ui.yaml </strong> <br> |
| 20 | + You <strong>must</strong> customize these files to suit you. This pattern __ was used in file reading operations. Let's not overlook it. <br> |
| 21 | + Note that you must use all four of these deployment yaml's. <br> |
26 | 22 |
|
27 | 23 | * The strategy pattern has been used so that the project can work with more than one data center. <br> |
28 | 24 | You <strong>must</strong> define the data center strategy you want to use. After that, it will be enough to send it in the <strong>data_center</strong> field. <br> |
29 | 25 |
|
30 | | -* In the <i>resources</i> folder of our application we have: <br> |
31 | | - <strong>master-deployment.yaml , worker-deployment.yaml , master-service.yaml , master-service-ui.yaml .</strong> <br> |
32 | | - You <strong>must</strong> customize these files to suit you. This pattern __ was used in file reading operations. Let's not overlook it. |
| 26 | +The following are the flows that we have implemented in this project. |
| 27 | + |
| 28 | +### Create deployment flow |
| 29 | + - Deploy master |
| 30 | + - Roll out status |
| 31 | + - Deploy worker |
| 32 | + - Roll out status |
| 33 | + - Create service |
| 34 | + - Create service ui |
| 35 | + - Print pod status |
| 36 | + - Retrieve service list |
| 37 | + - Print service status |
| 38 | + |
| 39 | +### Scale deployment flow |
| 40 | + - Scale deployment |
| 41 | + - Roll out status |
| 42 | + |
| 43 | +### Terminate deployment flow |
| 44 | + - Delete master deployment |
| 45 | + - Delete worker deployment |
| 46 | + - Delete master service |
| 47 | + - Delete master ui service |
33 | 48 |
|
| 49 | +--- |
34 | 50 |
|
35 | | -### Tech Stack |
| 51 | +##### Tech Stack |
36 | 52 | - Java 11 |
37 | 53 | - Spring Boot |
38 | 54 | - Kubernetes Client |
39 | 55 |
|
40 | | -### Requirements |
| 56 | +##### Requirements |
41 | 57 |
|
42 | 58 | For building and running the application, you need: |
43 | 59 | - [JDK 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) |
44 | 60 | - [Maven](https://maven.apache.org) |
45 | 61 | - [Lombok](https://projectlombok.org/) |
46 | 62 |
|
47 | | -### Build & Run |
| 63 | +##### Build & Run |
48 | 64 |
|
49 | 65 | ``` |
50 | | - SPRING_PROFILES_ACTIVE=prod |
51 | 66 | mvn clean install |
52 | 67 | mvn --projects kubernetes-operator-api spring-boot:run |
53 | 68 | ``` |
54 | 69 |
|
55 | | -### Port |
| 70 | +##### Port |
56 | 71 | ``` |
57 | 72 | http://localhost:1234 |
58 | 73 | ``` |
59 | 74 |
|
60 | | -### License |
| 75 | +##### License |
61 | 76 |
|
62 | | -Distributed under the MIT License. See [LICENSE](LICENSE) for more information. |
| 77 | +Distributed under the MIT License. See [LICENSE](LICENSE) for more information. |
0 commit comments