meshery-operator

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0

README

Shows an illustrated light mode meshery logo in light color mode and a dark mode meshery logo dark color mode.

Docker Pulls Go Report Card Build Status GitHub codecov Website Twitter Follow

Slack CII Best Practices


A self-service engineering platform, Meshery, is the open source, cloud native manager that enables the design and management of all Kubernetes-based infrastructure and applications. Among other features, as an extensible platform, Meshery offers visual and collaborative GitOps, freeing you from the chains of YAML while managing Kubernetes multi-cluster deployments.


Meshery Operator

Meshery Community Meshery Operator (docs) is a Kubernetes Operator that deploys and manages the lifecycle of two Meshery components critical to Meshery’s operations of Kubernetes clusters. Deploy one Meshery Operator per Kubernetes cluster under management - whether Meshery Server is deploy inside or outside of the clusters under management.




MeshSync

MeshSync (docs) is an event-driven, continuous synchronization controller responsibe for the task of ensuring that the state of configuration and status of operation of any infrastructure under management are known to Meshery. MeshSync runs as a Kubernetes custom controller under the control of Meshery Operator.




Meshery Broker

Meshery Broker (docs) is a custom Kubernetes controller that provides data streaming across independent components of Meshery whether those components are running inside or outside of the Kubernetes cluster.





Contributing

Please do! We're a warm and welcoming community of open source contributors. Please join. All types of contributions are welcome. Be sure to read the Contributor Guides for a tour of resources available to you and how to get started.

Building and testing

Meshery Operator is a Kubebuilder-based Kubernetes operator. Every build and test workflow is driven by the Makefile — run make help for the categorized list of targets. For deeper detail, see docs/development.md and docs/testing.md.

Prerequisites

  • Go 1.26.4 — the version pinned in go.mod (CI resolves it via go-version-file).
  • Docker — for building the manager image and running the kind end-to-end suite.
  • kubectl and kind on your PATH — for running against a cluster and for the end-to-end suite.
  • helm — only for make nats-manifests (a build-time tool; the operator has no Helm runtime dependency — it embeds and applies the rendered manifests itself).
  • operator-sdk — only for make bundle.

You do not need to install kustomize, controller-gen, setup-envtest, or golangci-lint (nor kind/opm) yourself — the Makefile installs them on demand into ./bin at pinned versions.

Common commands

Command Purpose
make build Compile the manager (cmd/main.go) into bin/manager.
make test Unit + envtest integration tests (no real cluster needed).
make lint / make lint-fix Run / auto-fix golangci-lint.
make manifests generate Regenerate CRDs, RBAC, and DeepCopy code.
make nats-manifests Re-render the vendored NATS broker manifests.
make run Run the manager on your host against the current kube-context.
make install / make deploy Install CRDs / deploy the operator into the cluster.
make integration-tests Full kind end-to-end cycle (setup, assert, cleanup).
make bundle Generate and validate the OLM bundle.

Build

make build   # compiles cmd/main.go into bin/manager

Code generation

CRDs, the RBAC ClusterRole, and the DeepCopy methods are generated from +kubebuilder markers. After changing API types or markers, regenerate and commit the output alongside your change:

make manifests generate

The vendored NATS broker manifests are rendered from the pinned official NATS Helm chart (nats/nats, version NATS_CHART_VERSION in the Makefile) using the values in pkg/broker/chart/values.yaml. This is how you change the NATS topology — edit the values (or bump the chart version), then re-render:

make nats-manifests   # regenerates pkg/broker/manifests/nats.gen.yaml

A CI drift gate (.github/workflows/nats-chart-drift.yml) re-runs make nats-manifests and fails if the committed pkg/broker/manifests/nats.gen.yaml is stale, so be sure to commit the regenerated file.

Lint

make lint       # run golangci-lint
make lint-fix   # run golangci-lint and apply fixes

Unit and integration tests (envtest)

make test runs the unit tests plus the Ginkgo/Gomega suites that reconcile the controllers/ reconcilers and the pkg/ (broker, meshsync) builders against a real kube-apiserver + etcd — no real cluster required. It auto-provisions the envtest control-plane binaries for ENVTEST_K8S_VERSION via setup-envtest and exports KUBEBUILDER_ASSETS for you.

make test

envtest has no kubelet, so Pods never actually run; tests that need endpoint or health behavior drive workload .status explicitly via the status subresource.

Run against a cluster

Run the manager on your host against the current kube-context, or deploy it into the cluster:

make install    # install the CRDs into the current cluster
make run        # run the manager locally against your kube-context

make deploy     # deploy the manager into the cluster
make undeploy   # remove the manager from the cluster

End-to-end tests (kind)

The end-to-end suite builds the operator image, loads it into a kind cluster, deploys the operator, applies the Broker/MeshSync samples, and asserts that the broker and meshsync workloads become ready. It needs Docker and kind. KIND_NODE_IMAGE pins the Kubernetes version (CI sets it so cluster versions don't drift between runs).

make integration-tests          # full cycle: setup, assert, cleanup
# or step by step:
make integration-tests-setup
make integration-tests-run
make integration-tests-cleanup

OLM bundle

make bundle regenerates the Operator Lifecycle Manager bundle and validates it (operator-sdk bundle validate ./bundle runs as part of the target). It requires operator-sdk on your PATH.

make bundle

Join the Meshery community!

Our projects are community-built and welcome collaboration. 👍 Be sure to see the Contributor Welcome Guide and Community Handbook for a tour of resources available to you. Jump into community Slack or discussion forum to participate.

Meshery Community

Find your MeshMate

MeshMates are experienced Meshery community members, who will help you learn your way around, discover live projects, and expand your community network. Conneect with a Meshmate today!

Find out more on the Meshery community.



Meshery Cloud Native Community

✔️ Join any or all of the weekly meetings on community calendar.
✔️ Watch community meeting recordings.
✔️ Fill-in a community member form to gain access to community resources.
✔️ Discuss in the Community Forum.
✔️ Explore more in the Community Handbook.



Shows an illustrated light mode meshery logo in light color mode and a dark mode meshery logo dark color mode.

Not sure where to start? Grab an open issue with the help-wanted label.



 

License

This repository and site are available as open-source under the terms of the Apache 2.0 License.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the meshery v1alpha1 API group +kubebuilder:object:generate=true +groupName=meshery.io
Package v1alpha1 contains API Schema definitions for the meshery v1alpha1 API group +kubebuilder:object:generate=true +groupName=meshery.io
v1alpha2
Package v1alpha2 contains API Schema definitions for the meshery v1alpha2 API group.
Package v1alpha2 contains API Schema definitions for the meshery v1alpha2 API group.
pkg
metrics
Package metrics defines and registers the Prometheus metrics exported by the Meshery Operator.
Package metrics defines and registers the Prometheus metrics exported by the Meshery Operator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL