You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-26Lines changed: 45 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,38 @@
1
-
# uptimeguardian
2
-
// TODO(user): Add simple overview of use/purpose
1
+
# Uptime Guardian Operator
2
+
UptimeGuardian is an OpenShift operator which runs in the Hub cluster and watches `Routes` in the Spoke clusters and creates corresponding Prometheus `Probes` in the Hub cluster.
3
3
4
4
## Description
5
-
// TODO(user): An in-depth paragraph about your project and overview of use
5
+
UptimeGuardian is designed to operate in a hub-spoke architecture, where it is installed on the hub (mothershift) cluster. The operator performs the following key functions:
6
+
7
+
1. Watches `HostedCluster` Custom Resources (CRs) in the hub cluster to discover and maintain connections with spoke (childshift) clusters
8
+
2. Establishes secure connections to the spoke clusters using the credentials and configuration from the `HostedCluster` CRs
9
+
3. Monitors `Routes` in the spoke clusters based on configured label selectors
10
+
4. Creates and manages corresponding Prometheus `Probe` resources in the hub cluster
11
+
12
+
To use UptimeGuardian, you need to:
13
+
1. Install the operator in your hub cluster
14
+
2. Create an `UptimeProbe` CR in the hub cluster with configuration including:
15
+
- Label selectors to identify which Routes to monitor in the spoke clusters
16
+
- Target namespace where the Prometheus Probes will be created in the hub cluster
17
+
- Any additional monitoring configuration like intervals, timeouts, etc.
18
+
19
+
The operator automatically handles the synchronization between spoke cluster Routes and hub cluster Probes, ensuring your routes are continuously monitored for availability.
6
20
7
21
## Getting Started
8
22
9
23
### Prerequisites
10
-
- go version v1.21.0+
11
-
- docker version 17.03+.
12
-
- kubectl version v1.11.3+.
13
-
- Access to a Kubernetes v1.11.3+ cluster.
24
+
- go version v1.23.0+
25
+
- docker version 20.10+.
26
+
- kubectl version v1.23.0+.
27
+
- Access to a OpenShift cluster v4.14+
14
28
15
29
### To Deploy on the cluster
16
30
**Build and push your image to the location specified by `IMG`:**
17
31
18
32
```sh
19
-
make docker-build docker-push IMG=<some-registry>/uptimeguardian:tag
33
+
make docker-build docker-push IMG=ghcr.io/stakater/uptimeguardian:tag
20
34
```
21
35
22
-
**NOTE:** This image ought to be published in the personal registry you specified.
23
-
And it is required to have access to pull the image from the working environment.
24
-
Make sure you have the proper permission to the registry if the above commands don’t work.
25
-
26
36
**Install the CRDs into the cluster:**
27
37
28
38
```sh
@@ -32,7 +42,7 @@ make install
32
42
**Deploy the Manager to the cluster with the image specified by `IMG`:**
33
43
34
44
```sh
35
-
make deploy IMG=<some-registry>/uptimeguardian:tag
45
+
make deploy IMG=ghcr.io/stakater/uptimeguardian:tag
36
46
```
37
47
38
48
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
@@ -66,31 +76,40 @@ make uninstall
66
76
make undeploy
67
77
```
68
78
69
-
##Project Distribution
79
+
### Development
70
80
71
-
Following are the steps to build the installer and distribute this project to users.
81
+
**Running the operator locally:**
72
82
73
-
1. Build the installer for the image built and published in the registry:
83
+
Ensure you are connected to the Hub cluster and your kubeconfig is set to use the Hub cluster context.
84
+
Install the CRDs as mentioned in the [To Deploy on the cluster](#to-deploy-on-the-cluster) section and run the operator locally.
74
85
75
86
```sh
76
-
make build-installer IMG=<some-registry>/uptimeguardian:tag
87
+
make run
77
88
```
78
89
79
-
NOTE: The makefile target mentioned above generates an 'install.yaml'
80
-
file in the dist directory. This file contains all the resources built
81
-
with Kustomize, which are necessary to install this project without
82
-
its dependencies.
90
+
**Running E2E Tests:**
91
+
Use the provided VSCode launch configuration to execute the end-to-end tests. The launch file contains the necessary configuration for running tests in your development environment. `Debug E2E Tests` is the launch configuration for running the end-to-end tests. It have environment variables which can be used to configure the test. To run the test in VSCode, you need to select the test name and then click on the `Debug E2E Tests` launch configuration.
83
92
84
-
2. Using the installer
93
+
If you want to run the test outside of VSCode, you can run the following command (make sure you have all the environment variables set mentioned in the launch configuration `launch.json`):
85
94
86
-
Users can just run kubectl apply -f <URLforYAMLBUNDLE> to install the project, i.e.:
95
+
```sh
96
+
make test-e2e
97
+
```
98
+
99
+
**Running Unit Tests:**
100
+
Apart from using the VSCode launch configuration (by selecting the any unit test name as regex and then clicking on the `Debug Unit Tests` launch configuration), you can also run the unit tests using the following command:
87
101
88
102
```sh
89
-
kubectl apply -f https://raw.githubusercontent.com/<org>/uptimeguardian/<tag or branch>/dist/install.yaml
103
+
make test
90
104
```
91
105
92
-
## Contributing
93
-
// TODO(user): Add detailed information on how you would like others to contribute to this project
106
+
## Contributing to UptimeGuardian!
107
+
108
+
Before submitting a pull request:
109
+
1. Ensure all tests pass locally
110
+
2. Add tests / e2e tests for any new features
111
+
3. Update documentation as needed
112
+
4. Follow the existing code style and conventions
94
113
95
114
**NOTE:** Run `make help` for more information on all potential `make` targets
0 commit comments