{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24873","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24873/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24873/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24873/events","html_url":"https://github.com/kubernetes/kubernetes/issues/24873","id":151441504,"number":24873,"title":"Is there a way to generate yml files that will produce the existing cluster?","user":{"login":"dcowden","id":1297923,"avatar_url":"https://avatars.githubusercontent.com/u/1297923?v=3","gravatar_id":"","url":"https://api.github.com/users/dcowden","html_url":"https://github.com/dcowden","followers_url":"https://api.github.com/users/dcowden/followers","following_url":"https://api.github.com/users/dcowden/following{/other_user}","gists_url":"https://api.github.com/users/dcowden/gists{/gist_id}","starred_url":"https://api.github.com/users/dcowden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcowden/subscriptions","organizations_url":"https://api.github.com/users/dcowden/orgs","repos_url":"https://api.github.com/users/dcowden/repos","events_url":"https://api.github.com/users/dcowden/events{/privacy}","received_events_url":"https://api.github.com/users/dcowden/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/ux","name":"team/ux","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-27T17:21:43Z","updated_at":"2016-04-29T02:14:11Z","closed_at":null,"body":"Given a kubernetes cluster that is running some number of pods, services, deployments, etc, I would like to generate one or more files ( yml format preferred) that would re-produce the current configuration, when applied to a new cluster.\r\n\r\nMy use case is a promotion system.  I have my 'stack files' as yml files in a git repo, but I need to allow humans to approve changes before they are applied to the cluster.\r\n\r\nOne way to do this is to use an 'open loop' system.  I can use tags or other mechanisms to determine which versions have been applied to the cluster, and then compare the latest version available with the latest deployed version.  \r\n\r\nThe problem with the open-loop system is that it does not consider that changes could have been made outside the files, or that changes applied could have had problems, etc.  \r\n\r\nIf I could extract the 'equivalent' files from a running cluster, I could compare them with the ones that are about to be applied.  This is a much stronger, 'closed loop' system-- it is able to correctly understand what will happen when the changes are applied, even if we have lost track of the real target state.\r\n\r\nif there were such a thing as kubectl apply -f <filename> --dry-run, which lists only the changes that will be made, rather than actually doing the changes, that would work as well.  That is already being discussed over at issue https://github.com/kubernetes/kubernetes/issues/11488\r\n\r\nDoes anyone have thoughts on this?   We are new to kubernetes, but we have created the the functionality I'm describing above for our RedHat/Satellite rpm-based deployments, so i want to re-create it in K8s. Of course, in k8s, we have the complexity that the infrastructure itself can change, not just installed package versions!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/215612118","html_url":"https://github.com/kubernetes/kubernetes/issues/24873#issuecomment-215612118","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24873","id":215612118,"user":{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T02:14:11Z","updated_at":"2016-04-29T02:14:11Z","body":"kubectl get po,deployment,rc,rs,ds,no,job -o yaml?"}}