{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/58","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/58/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/58/events","html_url":"https://github.com/GoogleCloudPlatform/metacontroller/issues/58","id":332840972,"node_id":"MDU6SXNzdWUzMzI4NDA5NzI=","number":58,"title":"support updating status of resources managed by other controllers","user":{"login":"gurvindersingh","id":186077,"node_id":"MDQ6VXNlcjE4NjA3Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/186077?v=4","gravatar_id":"","url":"https://api.github.com/users/gurvindersingh","html_url":"https://github.com/gurvindersingh","followers_url":"https://api.github.com/users/gurvindersingh/followers","following_url":"https://api.github.com/users/gurvindersingh/following{/other_user}","gists_url":"https://api.github.com/users/gurvindersingh/gists{/gist_id}","starred_url":"https://api.github.com/users/gurvindersingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurvindersingh/subscriptions","organizations_url":"https://api.github.com/users/gurvindersingh/orgs","repos_url":"https://api.github.com/users/gurvindersingh/repos","events_url":"https://api.github.com/users/gurvindersingh/events{/privacy}","received_events_url":"https://api.github.com/users/gurvindersingh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-15T16:32:13Z","updated_at":"2018-06-15T17:19:55Z","closed_at":null,"author_association":"NONE","body":"Thanks @enisoc for your efforts. This makes writing controller much easier :)\r\n\r\nI am trying to write a controller to create a load balancer service in external load balancer when a service is created in the cluster with `type: LoadBalancer`. I  also need to create a corresponding `NetworkPolicy`to allow traffic from LB nodes to worker nodes for the given service. Looking from the document `DecoratorController` seems like a close fit (with an issue) as `CompositeController` assumes ownership of parentresource. In my current use case parentresource is `Service.v1`. \r\n\r\n`DecoratorController` creates the desired `NetworkPolicy` object but does not allow me to update the `Status`field of  the service which is target resource as defined below. \r\n\r\n```yaml\r\napiVersion: metacontroller.k8s.io/v1alpha1\r\nkind: DecoratorController\r\nmetadata:\r\n  name: lb\r\nspec:\r\n  resources:\r\n  - apiVersion: v1\r\n    resource: services\r\n  attachments:\r\n  - apiVersion: networking.k8s.io/v1\r\n    resource: networkpolicies\r\n  hooks:\r\n    sync:\r\n      webhook:\r\n        url: http://service-per-pod.metacontroller/sync-lb\r\n```\r\n\r\nI need to update the `Status` field with info with newly created Loadbalancer IP and hostname, so users can see the IP address they can use to reach their service. I have created an [example](https://gist.github.com/gurvindersingh/3d361c5e0ea35fda98002bf649ea22c3) using jsonnet which in gist show I would like to use.\r\n\r\nSo wondering is there any plan to add support for this feature in `DecoratorController` or create any other controller which can let me do what I need in this use case."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/comments/397687743","html_url":"https://github.com/GoogleCloudPlatform/metacontroller/issues/58#issuecomment-397687743","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/metacontroller/issues/58","id":397687743,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzY4Nzc0Mw==","user":{"login":"enisoc","id":6733629,"node_id":"MDQ6VXNlcjY3MzM2Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/6733629?v=4","gravatar_id":"","url":"https://api.github.com/users/enisoc","html_url":"https://github.com/enisoc","followers_url":"https://api.github.com/users/enisoc/followers","following_url":"https://api.github.com/users/enisoc/following{/other_user}","gists_url":"https://api.github.com/users/enisoc/gists{/gist_id}","starred_url":"https://api.github.com/users/enisoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enisoc/subscriptions","organizations_url":"https://api.github.com/users/enisoc/orgs","repos_url":"https://api.github.com/users/enisoc/repos","events_url":"https://api.github.com/users/enisoc/events{/privacy}","received_events_url":"https://api.github.com/users/enisoc/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T17:19:55Z","updated_at":"2018-06-15T17:19:55Z","author_association":"MEMBER","body":"DecoratorController doesn't let you modify `status` because your changes would be overwritten anyway by the real Service controller. The Kubernetes controller model allows multiple users/clients/controllers to collaboratively edit `spec`, but `status` is completely owned by only one canonical controller for a given resource.\r\n\r\nThe usual way to plug in an implementation for `type: LoadBalancer` is through the `cloudprovider` interface. Unfortunately, this plug-in mechanism is not designed around controllers. Since the Service controller code interacts with the LoadBalancer implementation through compiled-in function calls, rather than through declarative API objects, there's not a perfect way for Metacontroller to help here short of replacing the Service controller entirely.\r\n\r\nIf the only reason you need to update status is to communicate the external IP to users, you could put that info in an annotation. It's not ideal because you'd need to tell users to look in a different place than usual, but that might be acceptable depending on your use case."}}
{"actor":{"display_login":"enisoc"}}