operator

command module
v0.0.0-...-0bb286d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

Webmesh Operator

The repository contains an operator for running Webmesh nodes on Kubernetes.

Getting started

You must have cert-manager installed first. This is used to generate TLS certificates for the mesh. You can install it by running:

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml

You can deploy the operator to an existing repository by cloning this repository and running:

make deploy

You can also use the kustomize manifests in the config directory to deploy the operator to an existing cluster.

Using K3d

The Makefile contains helpers for doing the same locally via a k3d cluster. It should work the same on a kind cluster. But you'll need a load balancer (e.g. metallb) to expose the nodes.

To setup a k3d cluster run:

# You can skip the docker-build step if you have the image pulled locally
make docker-build run-k3d

Once the cluster is ready, you can install the operator and CRDs to the local cluster by running:

make install-operator

By default the operator will run in the webmesh-system namespace:

$ kubectl get pod -n webmesh-system
NAME                                          READY   STATUS    RESTARTS   AGE
operator-controller-manager-67cc849c6-7nlbk   1/1     Running   0          55s

Example manifests can be found in the config/samples directory. To bootstrap a new mesh, you can create a Mesh resource:

$ kubectl apply -f config/samples/mesh_v1_mesh.yaml
mesh.mesh.webmesh.io/mesh-sample created

When the mesh is ready, you should have 4 pods running. Three bootstrap nodes and a load-balancer node that exposes the mesh to the outside world:

$ kubectl get pod
NAME                         READY   STATUS    RESTARTS   AGE
mesh-sample-bootstrap-0      1/1     Running   0          46s
mesh-sample-bootstrap-1      1/1     Running   0          46s
mesh-sample-bootstrap-2      1/1     Running   0          46s
mesh-sample-bootstrap-lb-0   1/1     Running   0          41s

An admin configuration for the wmctl utility in the node repository is written to a secret. You can retrieve it by running:

make get-config

Building

This is just your typical kubebuilder project. You can build the operator by running:

make docker-build

Run make help to see all the available targets.

Contributing

Contributions are welcome. Please feel free to open an issue or a pull request. One thing I'd like to get done in the short-term is support for creating nodes across all the major cloud providers. Currently only GCP Compute Instances are supported.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the mesh v1 API group +kubebuilder:object:generate=true +groupName=mesh.webmesh.io
Package v1 contains API Schema definitions for the mesh v1 API group +kubebuilder:object:generate=true +groupName=mesh.webmesh.io
cloudconfig
Package cloudconfig contains Webmesh node cloud config rendering.
Package cloudconfig contains Webmesh node cloud config rendering.
nodeconfig
Package nodeconfig contains Webmesh node configuration rendering.
Package nodeconfig contains Webmesh node configuration rendering.
resources
Package resources contains Kubernetes resource definitions.
Package resources contains Kubernetes resource definitions.
version
Package version contains compile-time version information.
Package version contains compile-time version information.

Jump to

Keyboard shortcuts

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