Skip to content

Commit aaf3af8

Browse files
committed
config page proposal
Signed-off-by: axif <[email protected]>
1 parent c686b70 commit aaf3af8

File tree

6 files changed

+228
-0
lines changed

6 files changed

+228
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
---
2+
title: @axif0
3+
authors:
4+
- "@robot" # Authors' github accounts here.
5+
reviewers:
6+
- "@robot"
7+
- TBD
8+
approvers:
9+
- "@robot"
10+
- TBD
11+
12+
creation-date: 2024-08-12
13+
14+
---
15+
16+
# Configuration of karmada components
17+
18+
<!--
19+
This is the title of your KEP. Keep it short, simple, and descriptive. A good
20+
title can help communicate what the KEP is and should be considered as part of
21+
any review.
22+
-->
23+
24+
## Summary
25+
26+
<!--
27+
This section is incredibly important for producing high-quality, user-focused
28+
documentation such as release notes or a development roadmap.
29+
30+
A good summary is probably at least a paragraph in length.
31+
-->
32+
To streamline the explanation of Karmada's role in managing multi-cluster Kubernetes environments, Karmada simplifies managing cloud-native applications across multiple Kubernetes clusters and clouds without altering the applications themselves.
33+
34+
This approach ensures seamless integration with existing Kubernetes tools and avoids vendor lock-in, making it a versatile choice for organizations looking to optimize their Kubernetes deployments across various environments.
35+
## Motivation
36+
37+
<!--
38+
This section is for explicitly listing the motivation, goals, and non-goals of
39+
this KEP. Describe why the change is important and the benefits to users.
40+
-->
41+
The motivation behind this project seems to be providing an easy-to-use interface for monitoring and managing Kubernetes deployments, specifically tailored for environments where applications are deployed using Karmada, a Kubernetes-native multi-cluster management system. The dashboard simplifies common tasks such as checking deployment health, restarting deployments, viewing pod logs or editing components raw manifest which can be crucial for maintaining the stability and performance of applications running in Kubernetes clusters.
42+
43+
44+
### Goals
45+
46+
<!--
47+
List the specific goals of the KEP. What is it trying to achieve? How will we
48+
know that this has succeeded?
49+
-->
50+
51+
- `Listing Running Applications` which fetches and displays the names of applications currently running in the Kubernetes cluster.
52+
- `Fetching Pod Metadata` where given an app label, it retrieves metadata about the pods associated with that app.
53+
- Allows checking the `status of a specific deployment`, indicating whether it has been fully deployed.
54+
- `Restarting Deployments` provides functionality to restart a given deployment.
55+
- `Deleting Pods` Offers the ability to delete a specific pod.
56+
- `Retrieving Pod Logs` Fetches and displays the logs for a specified pod.
57+
- `edit the components' raw manifest`
58+
59+
### Non-Goals
60+
61+
<!--
62+
What is out of scope for this KEP? Listing non-goals helps to focus discussion
63+
and make progress.
64+
-->
65+
66+
## Proposal
67+
68+
<!--
69+
This is where we get down to the specifics of what the proposal actually is.
70+
This should have enough detail that reviewers can understand exactly what
71+
you're proposing, but should not include things like API designs or
72+
implementation. What is the desired outcome and how do we measure success?.
73+
The "Design Details" section below is for the real
74+
nitty-gritty.
75+
-->
76+
77+
### User Stories (Optional)
78+
79+
<!--
80+
Detail the things that people will be able to do if this KEP is implemented.
81+
Include as much detail as possible so that people can understand the "how" of
82+
the system. The goal here is to make this feel real for users without getting
83+
bogged down.
84+
-->
85+
86+
#### Story 1
87+
88+
Interacting to the systems Architect, dashboard users want to integrate Karmada with existing CI/CD pipelines to automate deployments and updates across multiple clusters. Users can monitor and troubleshoot deployments across clusters from a central dashboard. Also can update the applications.
89+
90+
91+
### Notes/Constraints/Caveats (Optional)
92+
93+
<!--
94+
What are the caveats to the proposal?
95+
What are some important details that didn't come across above?
96+
Go in to as much detail as necessary here.
97+
This might be a good place to talk about core concepts and how they relate.
98+
-->
99+
100+
### Risks and Mitigations
101+
102+
<!--
103+
What are the risks of this proposal, and how do we mitigate?
104+
105+
How will security be reviewed, and by whom?
106+
107+
How will UX be reviewed, and by whom?
108+
109+
Consider including folks who also work outside the SIG or subproject.
110+
-->
111+
112+
## Design Details
113+
114+
<!--
115+
This section should contain enough information that the specifics of your
116+
change are understandable. This may include API specs (though not always
117+
required) or even code snippets. If there's any ambiguity about HOW your
118+
proposal will be implemented, this is the place to discuss them.
119+
-->
120+
![alt text](details.png)
121+
### Karmada Management API
122+
123+
```markdown
124+
This API provides a set of endpoints for managing and monitoring Karmada components in the `karmada-system` namespace. The API translates requests into corresponding Kubernetes commands, enabling automation and integration with other tools or interfaces.
125+
```
126+
### API Endpoints
127+
128+
### 1. Get Running Pods
129+
130+
- **Command**:
131+
```bash
132+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system get pods -o json
133+
```
134+
- **API**: `/config/running-pods`
135+
- **Purpose**: Fetches an overview of all running Karmada components, including metadata such as UID, creation timestamp, name, etc.
136+
137+
### 2. Get Pod Metadata
138+
139+
- **Command**:
140+
```bash
141+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system get pods -o json
142+
```
143+
- **API**: `/config/apps/:appLabel`
144+
- **Purpose**: Provides logs from a specified Karmada pod for debugging or monitoring purposes.
145+
146+
### 3. Fetch Logs
147+
148+
- **Command**:
149+
```bash
150+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system logs {pod_name}
151+
```
152+
- **API**: `/config/log/{pod_name}`
153+
- **Purpose**: Provides logs from a specified Karmada pod for debugging or monitoring purposes.
154+
155+
### 4. Restart Deployment
156+
157+
- **Command**:
158+
```bash
159+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system rollout restart deployment/{app_name}
160+
```
161+
- **API**: `/config/restart/{app_name}`
162+
- **Purpose**: Restarts the specified Karmada component to apply updates or recover from issues.
163+
164+
### 5. Check Deployment Status
165+
166+
- **Command**:
167+
```bash
168+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system rollout status deployment/{app_name}
169+
```
170+
- **API**: `/cluster/status/{app_name}`
171+
- **Purpose**: Monitors the rollout status of a Karmada deployment to ensure it is running correctly.
172+
173+
### 6. Reinstall Pod
174+
175+
- **Command**:
176+
```bash
177+
kubectl --kubeconfig $KUBECONFIG --context karmada-host -n karmada-system delete pod {pod_name}
178+
```
179+
- **API**: `/config/reinstall/{pod_name}`
180+
- **Purpose**: Deletes a specific Karmada pod, which will typically result in its automatic recreation.
181+
182+
## How to Use
183+
184+
Each of the API endpoints corresponds to a specific Kubernetes command used to manage Karmada components. The API can be integrated into your automation tools or used manually via `curl` commands to interact with the Karmada system.
185+
186+
### Example Usage
187+
188+
```bash
189+
# Get running pods
190+
curl http://localhost:8000/api/v1/config/running-pods
191+
192+
curl http://localhost:8000/api/v1/config/apps/karmada-webhook
193+
194+
# Fetch logs of a specific pod
195+
curl http://localhost:8000/api/v1/config/log/karmada-webhook-5cbd5f8f46-ljqjq
196+
197+
# Restart a specific app deployment
198+
curl http://localhost:8000/api/v1/config/restart/karmada-aggregated-apiserver
199+
200+
# Check deployment status
201+
curl http://localhost:8000/api/v1/config/status/karmada-scheduler-estimator-member2
202+
203+
# Reinstall (delete) a specific pod
204+
curl http://localhost:8000/api/v1/config/reinstall/karmada-webhook-5cbd5f8f46-642bg
205+
```
206+
207+
208+
# Frontend Changes
209+
210+
## Check Status & logs
211+
212+
![alt text](status.png)
213+
214+
215+
## reinstall
216+
![alt text](reinstall.png)
217+
218+
## restart
219+
![alt text](restart.png)
220+
221+
## Update
222+
223+
![alt text](update.png)
224+
225+
226+
### Test Plan
227+
228+
## Alternatives
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)