k8s-replicator

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0

README

Kubernetes Replicator

License Main Branch Build

Replicator for Kubernetes resources across namespaces. This controller was written keeping extensibility 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
  • Clone this repository.

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

  • Apply the controller into your cluster.

    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/target-namespace=ignored
    

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

replicator.nadundesilva.github.io/target-namespace=replicated

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 clone is used to mark the replicated objects.
    replicator.nadundesilva.github.io/object-type=clone
    
  • The following label is used to mark a replicated resource's source namespace.
    replicator.nadundesilva.github.io/source-namespace=<namespace>
    

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
replicator
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
pkg
config
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
kubernetes
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
replicator
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
replicator/resources
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
signals
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
version
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
test
e2e
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
utils/cleanup
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
utils/controller
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
utils/namespaces
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
utils/resources
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.
utils/validation
* Copyright (c) 2022, Nadun De Silva.
* Copyright (c) 2022, Nadun De Silva.

Jump to

Keyboard shortcuts

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