Skip to content

vshn/espejo

Repository files navigation

Espejo (object-syncer)

Build Go version Kubernetes version Version Maintainability GitHub downloads Docker image 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 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 will create a Service, Endpoints and NetworkPolicy object in all namespaces which mach the label selector 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 (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

Espejo supports both OpenShift 3.11 clusters and newer Kubernetes clusters 1.16+. However, to support OpenShift 3.11 a legacy CRD definition with apiextensions.k8s.io/v1beta1 is needed, while K8s 1.22+ only supports apiextensions.k8s.io/v1. You need node and npm to run the tests, as it runs with DETIK.

To run e2e tests, execute:

make e2e-test