k8s-replicator

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0

README

Kubernetes Replicator

Main Branch Build Vulnerabilities Scan License

Release Docker Image Docker Pulls

Replicator supports copying kubernetes resources across namespaces. This controller was written keeping extensibility and performance in mind. Therefore, it can be extended to any other resource as needed. The following resources are supported by the Kubernetes replicator.

  • Secrets

How to Use

How to Setup Controller
Quickstart

Run the following command to apply the controller to your cluster. The <VERSION> should be replaced with the release version to be used and kubectl CLI should be configured pointing to the cluter in which the controller needs to be started.

curl -L https://raw.githubusercontent.com/nadundesilva/k8s-replicator/main/installers/install.sh | bash -s <VERSION>
Manual Applying
  • Clone this repository.

  • Update the configuration (<REPOSITORY_ROOT>/kustomize/config.yaml) to match your needs.

  • Apply the controller into your cluster by running the following command.

    kubectl apply -k kustomize
    
How to mark a object to be replicated

Use the following label to mark the object to be replicated.

replicator.nadundesilva.github.io/object-type=source

All objects with the above label will replicated into all namespaces.

Ignored namespaces

The following namespaces are ignored by default.

  • The namespace in which controller resides
  • Namespaces with the name starting with kube- prefix
  • Namespaces with the label
    replicator.nadundesilva.github.io/namespace-type=ignored
    

If you want to override this behavior and specifically replicate to a namespace, add the following label

replicator.nadundesilva.github.io/namespace-type=managed
Additional labels used by the controller

The folloing labels are used by the controller to track the replication of resources.

  • The following label with the value replica is used to mark the replicated objects.
    replicator.nadundesilva.github.io/object-type=replica
    
  • The following label is used to mark a replicated resource's source namespace.
    replicator.nadundesilva.github.io/source-namespace=<namespace>
    
How to Cleanup Controller
Quick Remove

Run the following command to remove the controller from your cluster. Kubectl CLI should be configured pointing to the cluter in which the controller needs to be started.

Note: This approach would only work if you used the Quickstart option for setting up the controller.

curl -L https://raw.githubusercontent.com/nadundesilva/k8s-replicator/main/installers/uninstall.sh | bash -s
Manual Removal
  • Clone this repository.

  • Remove the controller into your cluster by running the following command.

    kubectl delete -k kustomize
    

Support

❔ If you need support or have a question about the K8s Replicator, reach out through Discussions.

🐛 If you have found a bug and would like to get it fixed, try opening a Bug Report.

💡 If you have a new idea or want to get a new feature or improvement added to the K8s Replicator, try creating a Feature Request.

Directories

Path Synopsis
cmd
pkg
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳