https://github.com/vshn/espejo
OpenShift and Kubernetes Object Syncer
https://github.com/vshn/espejo
kubernetes kubernetes-operator openshift openshift-operator operator-sdk vshn-project-ocp
Last synced: 11 months ago
JSON representation
OpenShift and Kubernetes Object Syncer
- Host: GitHub
- URL: https://github.com/vshn/espejo
- Owner: vshn
- License: bsd-3-clause
- Created: 2019-03-04T16:52:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-30T07:09:51.000Z (over 1 year ago)
- Last Synced: 2024-11-30T08:23:52.335Z (over 1 year ago)
- Topics: kubernetes, kubernetes-operator, openshift, openshift-operator, operator-sdk, vshn-project-ocp
- Language: Go
- Homepage:
- Size: 28.7 MB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Espejo](https://es.wikipedia.org/wiki/Espejo) (object-syncer)
[][build]


[][releases]
[][codeclimate]
[][releases]
[][dockerhub]
[][license]
The espejo tool (which means 'mirror' in Spanish) syncs objects from a SyncConfig CRD to multiple namespaces. The idea is to replace OpenShift's [project templates](https://docs.openshift.com/container-platform/3.11/admin_guide/managing_projects.html#modifying-the-template-for-new-projects) with a more flexible and robust solution.
## CustomResourceDefinitions
The operator introduces a CRD called `SyncConfig` to configure the objects which should be synced.
[This `SyncConfig`](config/samples/complete-syncconfig.yaml) will create a `Service`, `Endpoints` and `NetworkPolicy` object in all namespaces which mach the [label selector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#labelselector-v1-meta) OR one of the name selectors.
To ensure objects are deleted, set the `prune` parameter to `true` (default is `false`)
### Parameters
Strings within object definitions can be replaced with dynamic values with parameters. The following parameters can be used:
| Parameter Name | Description |
|------------------------------|------------------------------|
| `${PROJECT_NAME}` | Name of the target namespace |
## Development
The Operator is implemented with the [Operator SDK](https://github.com/operator-framework/operator-sdk) ([Installation](https://sdk.operatorframework.io/docs/installation/)).
### Build
* `make build` creates the `espejo` binary. Go is required.
* `make docker-build` creates the Docker image with `docker.io/vshn/espejo:latest` and `quay.io/vshn/espejo:latest` tags.
* `make test` runs all unit tests.
* `make integration-test` runs the integration tests.
### Run E2E tests
You need `node` and `npm` to run the tests, as it runs with [DETIK][detik].
To run e2e tests, execute:
```bash
make e2e-test
```
[build]: https://github.com/vshn/espejo/actions?query=workflow%3ATest
[releases]: https://github.com/vshn/espejo/releases
[license]: https://github.com/vshn/espejo/blob/master/LICENSE
[dockerhub]: https://hub.docker.com/r/vshn/espejo
[codeclimate]: https://codeclimate.com/github/vshn/espejo
[detik]: https://github.com/bats-core/bats-detik