File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ stop the watch (break the loop) based off of event logic.
2222 * ` GET /apis/batch/v1beta1/watch/cronjobs ` (resource type cluster-wide)
2323 * https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#watch
2424
25+ Other notes:
26+ - if using labelSelectors triggered events will fire with ADDED / DELETED types if the label is added/delete
27+ (ie: ADDED/DELETED do not necessarily equate to literally being added/deleted from k8s)
28+
2529# Development
2630Note on ` resourceVersion ` per the doc:
2731> When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to
Original file line number Diff line number Diff line change @@ -180,7 +180,14 @@ public static function InClusterConfig()
180180 $ config = new Config ();
181181 $ config ->setToken (file_get_contents ('/var/run/secrets/kubernetes.io/serviceaccount/token ' ));
182182 $ config ->setCertificateAuthorityPath ('/var/run/secrets/kubernetes.io/serviceaccount/ca.crt ' );
183- $ config ->setServer ('https://kubernetes.default.svc ' );
183+
184+ if (strlen (getenv ('KUBERNETES_SERVICE_HOST ' )) > 0 ) {
185+ $ server = 'https:// ' . getenv ('KUBERNETES_SERVICE_HOST ' ) . ': ' . getenv ('KUBERNETES_SERVICE_PORT ' );
186+ } else {
187+ $ server = 'https://kubernetes.default.svc ' ;
188+ }
189+
190+ $ config ->setServer ($ server );
184191
185192 return $ config ;
186193 }
You can’t perform that action at this time.
0 commit comments