operator

command module
v0.4.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

README

Operator

The Grey Matter Operator enables a bootstrapped mesh deployment using the greymatter.io/v1alpha1.Mesh CRD to manage mesh deployments in a Kubernetes cluster.

Prerequisites

NOTE: This project makes use of git submodules for dependency management.

Getting Started

Make sure you have fetched all necessary dependencies:

./scripts/bootstrap # checks that you have the latest dependencies for the cue evaluation of manifests.

Evaluate the kubernetes manifests using CUE:

( 
cd pkg/cuemodule
cue eval -c ./k8s/outputs --out text -e operator_manifests_yaml | kubectl apply -f -

kubectl create secret docker-registry gm-docker-secret \
  --docker-server=docker.greymatter.io \
  --docker-username=$GREYMATTER_REGISTRY_USERNAME \
  --docker-password=$GREYMATTER_REGISTRY_PASSWORD \
  --docker-email=$GREYMATTER_REGISTRY_USERNAME \
  -n gm-operator
)

HINT: Your username and password are your Grey Matter credentials.

The operator will be running in a pod in the gm-operator namespace, and shortly after installation, the default Mesh CR described in pkg/cuemodule/new_structure/inputs.cue will be automatically deployed.

Inspecting Manifests

The following commands print out manifests that can be applied to a Kubernetes cluster:

( 
  cd pkg/cuemodule
  cue eval -c ./k8s/outputs --out text -e spire_manifests_yaml
)

# pick which manifests you'd like to inspect

(
  cd pkg/cuemodule
  cue eval -c ./k8s/outputs --out text -e operator_manifests_yaml
)

OR with Kustomize:

kubectl kustomize config/context/kubernetes

NOTE: If deploying to OpenShift, you can replace config/context/kubernetes with config/context/openshift.)

Using nix-shell

For those using the Nix package manager, a shell.nix script has been provided at the root of this project to launch the operator in a local KinD cluster.

Some caveats:

  • You should have Docker and Nix installed
  • You should be able to login to docker.greymatter.io

To launch, simply run:

nix-shell

Development

Prerequisites

If building for OpenShift, you'll also need the OpenShift CLI.

Setup

Verify all dependency installations and update CUE modules:

./scripts/bootstrap

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=greymatter.io
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=greymatter.io
pkg
gmapi
Package gmapi executes greymatter CLI commands to configure mesh behavior in Control and Catalog APIs in each install namespace for each mesh.
Package gmapi executes greymatter CLI commands to configure mesh behavior in Control and Catalog APIs in each install namespace for each mesh.
mesh_install
Package mesh_install exposes functions for applying resources to a Kubernetes cluster.
Package mesh_install exposes functions for applying resources to a Kubernetes cluster.

Jump to

Keyboard shortcuts

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