Categorygithub.com/girishg4t/k8sResourceCloner
repositorypackage
0.0.0-20210216085750-82c228078e43
Repository: https://github.com/girishg4t/k8sresourcecloner.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

K8sResourceCloner

K8sResourceCloner is the kubernetes operator which will clone the given k8s resources from one namespace to another

How to run

There are diffrent ways to run the application

  1. Run locally outside the cluster
make install run
  1. Run as a Deployment inside the cluster
export USERNAME=<quay-namespace>
make docker-build docker-push IMG=quay.io/$USERNAME/K8sResourceCloner-operator:v0.0.1
make deploy IMG=quay.io/$USERNAME/K8sResourceCloner-operator:v0.0.1

Update config/samples/cache_v1alpha1_k8sresourcecloner.yaml

Update :
fromNamespace: from which the resources need to be cloned
toNamespaces: in which namespace it need to be cloned, mutiple namespaces are allowed
resourceNames: the resource name which need to be copied, mutiple resource name are allowed

apiVersion: cache.example.org/v1alpha1
kind: K8sResourceCloner
metadata:
  name: k8sresourcecloner-sample
spec:
  fromNamespace : default
  toNamespaces: 
  - test
  - demo
  resourceNames:  
  - mysecret
  - test-configMap

Create a K8sResourceCloner CR

kubectl apply -f config/samples/cache_v1alpha1_k8sresourcecloner.yaml

After deploying the above Custom resource, it will create the give resouces in specified namespace

Resources:

https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/