volrep-shim-operator

command module
v0.0.0-...-2f9f9b8 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

VolumeReplication Operator Shim

VolumeReplication Operator is a shim for a sample VolumeReplication kubernetes CRD that,

  • Uses the VolumeReplication CRD and manages its reconciliation
  • The PVC that is managed is as per the dataSource in the VolumeReplication CR and dataSource only handles PVCs at present
  • The operator reconciles the VolumeReplication CR based on PVC health (i.e it should be bound to a PV), and reflects the following in status
    • observedState reflects the state observed at the generation in observedGeneration
    • observedGeneration reflects the generation of the most recently observed volume replication
    • conditions
      • Type: "Reconciled" denotes resource was reconciled
        • Status: "Complete" denotes reconciliation was completed
        • Status: "Error" denotes reconciliation had errors

NOTE: Currently the shim operator supports (or, is tested with) kubernetes v1.19 and above

Build

The code is generated using the operator-sdk and comes with standard SDK targets in the Makefile.

The most common way to build an image would be,

$ make docker-build IMG=volrep-shim-operator:latest

To push the image to a docker repository use,

$ make docker-push docker-push IMG=volrep-shim-operator:latest

Deploy

Deploy to a kubernetes instance using,

$ make deploy IMG=volrep-shim-operator:latest

The artifacts are deployed in the volreplication-shim-system namespace and are,

$ kubectl get all -n volreplication-shim-system
NAME                                                          READY   STATUS    RESTARTS   AGE
pod/volreplication-shim-controller-manager-744cb9dc78-47ptb   2/2     Running   0          3m56s

NAME                                                             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/volreplication-shim-controller-manager-metrics-service   ClusterIP   10.104.17.255   <none>        8443/TCP   3m56s

NAME                                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/volreplication-shim-controller-manager   1/1     1            1           3m56s

NAME                                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/volreplication-shim-controller-manager-744cb9dc78   1         1         1       3m56s

Test

The sample VolumeReplication CR can be applied to the cluster running the operator as follows,

$ kubectl apply -f config/samples/replication_v1alpha1_volumereplication.yaml

NOTE: Sample above requires that a PVC named "sample-pvc" exists in the same namespace as the VolumeReplication resource

The reconcile logs can be viewed in parallel for the reconcile of the above created CR as follows,

$ kubectl logs -fn volreplication-shim-system deployment.apps/volreplication-shim-controller-manager -c manager

The status of reconciliation can be observed using,

$ kubectl get volumereplication volumereplication-sample -o jsonpath='{.status}'

Testing with minikube is the simplest, and a sample minikube PVC is present here.

If using podman to build and minikube with docker, then a helper script to copy the built image into minikube is present here

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the replication v1alpha1 API group +kubebuilder:object:generate=true +groupName=replication.storage.ramen.io
Package v1alpha1 contains API Schema definitions for the replication v1alpha1 API group +kubebuilder:object:generate=true +groupName=replication.storage.ramen.io

Jump to

Keyboard shortcuts

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