vbehar / openshift-git

Import/Export OpenShift resources from/to a Git repository
Apache License 2.0
8 stars 3 forks source link

Too frequent updates #5

Open varac opened 6 years ago

varac commented 6 years ago

I running openshift-git on openshift for exporting resources from the whole cluster. This is how opensift-git is run in the pod:

sh-4.2$ ps aux | more
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
openshift-git export ns,pv,scc,users,groups,bc,dc,rc,pods,is,svc,routes,templates,secrets,limits,quota,pvc,sa,configmaps,endpoints,imagestreamtags,limitranges,projects,replicationcontrollers,resourcequotas,rolebindings,roles,services --watch --all-namespaces --repository-path=/var/repository --repository-remote=... --repository-branch=master --repository-user-name=OpenShift --repository-user-email=openshift@example.com --repository-pull-period=2m --repository-push-period=2m --resync-period=1h --selector=git-export notin (ignore) --format=yaml --v=0

Every few seconds we have commits like this:

--- hexacab/openshift-git ‹master› » git show
commit 538b6a608bdc71a47f83af564a8be78a6d5873a2 (HEAD -> master, origin/master, origin/HEAD)
Author: OpenShift <openshift@example.com>
Date:   Thu Feb 1 12:12:17 2018

    Updated ConfigMap kube-system/kube-scheduler

diff --git a/Namespace/kube-system/ConfigMap/kube-scheduler.yaml b/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
index 65f73dcf..9163d9b6 100644
--- a/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
+++ b/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
@@ -2,6 +2,6 @@ apiVersion: v1
 kind: ConfigMap
 metadata:
   annotations:
-    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:30Z","renewTime":"2018-02-01T11:10:53Z","leaderTransitions":0}'
+    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:30Z","renewTime":"2018-02-01T11:10:55Z","leaderTransitions":0}'
   creationTimestamp: null
   name: kube-scheduler

How can those be filtered out/ignored so they dont clutter our repo ?

vbehar commented 6 years ago

ok, the issue is that something is updating the annotation very often I guess. unfortunately there is nothing in the code yet to filter out some changes. I'll see if it's easy to add

varac commented 6 years ago

So these resources change rapidly:

openshift-git ‹master› » git lg |head
* 85078f0 N  (HEAD -> master, origin/master, origin/HEAD) Updated ConfigMap kube-system/kube-controller-manager (82 seconds ago) <OpenShift>
* 2a717ba N  Updated Endpoints kube-service-catalog/service-catalog-controller-manager (82 seconds ago) <OpenShift>
* d4e4df3 N  Updated ConfigMap kube-system/kube-scheduler (83 seconds ago) <OpenShift>
* 15c431e N  Updated ConfigMap kube-system/openshift-master-controllers (83 seconds ago) <OpenShift>
* 3819478 N  Updated Endpoints kube-service-catalog/service-catalog-controller-manager (84 seconds ago) <OpenShift>
* 5f3c440 N  Updated ConfigMap kube-system/kube-scheduler (85 seconds ago) <OpenShift>
* 69da3de N  Updated ConfigMap kube-system/kube-controller-manager (85 seconds ago) <OpenShift>
* ab8c3d9 N  Updated Endpoints kube-service-catalog/service-catalog-controller-manager (86 seconds ago) <OpenShift>
* 5073d83 N  Updated ConfigMap kube-system/openshift-master-controllers (86 seconds ago) <OpenShift>
* 92f32ef N  Updated ConfigMap kube-system/kube-scheduler (87 seconds ago) <OpenShift>
openshift-git ‹master› » git show HEAD^^^^..HEAD | cat
commit 85078f08692c17b786bdc4320cc6a2f17e917bf8 (HEAD -> master, origin/master, origin/HEAD)
Author: OpenShift <openshift@example.com>
Date:   Thu Feb 1 17:17:26 2018

    Updated ConfigMap kube-system/kube-controller-manager

diff --git a/Namespace/kube-system/ConfigMap/kube-controller-manager.yaml b/Namespace/kube-system/ConfigMap/kube-controller-manager.yaml
index a18abda..e88fb2d 100644
--- a/Namespace/kube-system/ConfigMap/kube-controller-manager.yaml
+++ b/Namespace/kube-system/ConfigMap/kube-controller-manager.yaml
@@ -2,6 +2,6 @@ apiVersion: v1
 kind: ConfigMap
 metadata:
   annotations:
-    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster.example.org","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:29Z","renewTime":"2018-02-01T16:17:24Z","leaderTransitions":0}'
+    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster.example.org","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:29Z","renewTime":"2018-02-01T16:17:27Z","leaderTransitions":0}'
   creationTimestamp: null
   name: kube-controller-manager

commit 2a717ba6ebf7314e45d7887885537554270d6465
Author: OpenShift <openshift@example.com>
Date:   Thu Feb 1 17:17:26 2018

    Updated Endpoints kube-service-catalog/service-catalog-controller-manager

diff --git a/Namespace/kube-service-catalog/Endpoints/service-catalog-controller-manager.yaml b/Namespace/kube-service-catalog/Endpoints/service-catalog-controller-manager.yaml
index 3f76491..e3a138e 100644
--- a/Namespace/kube-service-catalog/Endpoints/service-catalog-controller-manager.yaml
+++ b/Namespace/kube-service-catalog/Endpoints/service-catalog-controller-manager.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
 kind: Endpoints
 metadata:
   annotations:
-    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"controller-manager-bplvb-external-service-catalog-controller","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:57:54Z","renewTime":"2018-02-01T16:17:24Z","leaderTransitions":0}'
+    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"controller-manager-bplvb-external-service-catalog-controller","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:57:54Z","renewTime":"2018-02-01T16:17:26Z","leaderTransitions":0}'
   creationTimestamp: null
   name: service-catalog-controller-manager
 subsets: []

commit d4e4df30820e2fa47e0404f2403ee45186a5ef30
Author: OpenShift <openshift@example.com>
Date:   Thu Feb 1 17:17:25 2018

    Updated ConfigMap kube-system/kube-scheduler

diff --git a/Namespace/kube-system/ConfigMap/kube-scheduler.yaml b/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
index fbd362b..280ca00 100644
--- a/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
+++ b/Namespace/kube-system/ConfigMap/kube-scheduler.yaml
@@ -2,6 +2,6 @@ apiVersion: v1
 kind: ConfigMap
 metadata:
   annotations:
-    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster.example.org","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:30Z","renewTime":"2018-02-01T16:17:24Z","leaderTransitions":0}'
+    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"atomicmaster.example.org","leaseDurationSeconds":15,"acquireTime":"2017-12-11T21:16:30Z","renewTime":"2018-02-01T16:17:26Z","leaderTransitions":0}'
   creationTimestamp: null
   name: kube-scheduler

commit 15c431e18a8562fa4bdb73cfdc22739e1c1478c3
Author: OpenShift <openshift@example.com>
Date:   Thu Feb 1 17:17:25 2018

    Updated ConfigMap kube-system/openshift-master-controllers

diff --git a/Namespace/kube-system/ConfigMap/openshift-master-controllers.yaml b/Namespace/kube-system/ConfigMap/openshift-master-controllers.yaml
index 789f859..e46aa99 100644
--- a/Namespace/kube-system/ConfigMap/openshift-master-controllers.yaml
+++ b/Namespace/kube-system/ConfigMap/openshift-master-controllers.yaml
@@ -2,6 +2,6 @@ apiVersion: v1
 kind: ConfigMap
 metadata:
   annotations:
-    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"master-atomicmaster.example.org-198.252.153.254-7p95tsbv","leaseDurationSeconds":15,"acquireTime":"2018-02-01T11:27:18Z","renewTime":"2018-02-01T16:17:22Z","leaderTransitions":22}'
+    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"master-atomicmaster.example.org-198.252.153.254-7p95tsbv","leaseDurationSeconds":15,"acquireTime":"2018-02-01T11:27:18Z","renewTime":"2018-02-01T16:17:25Z","leaderTransitions":22}'
   creationTimestamp: null
   name: openshift-master-controllers