{"action":"created","issue":{"url":"https://api.github.com/repos/fedora-modularity/conu/issues/155","repository_url":"https://api.github.com/repos/fedora-modularity/conu","labels_url":"https://api.github.com/repos/fedora-modularity/conu/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/fedora-modularity/conu/issues/155/comments","events_url":"https://api.github.com/repos/fedora-modularity/conu/issues/155/events","html_url":"https://github.com/fedora-modularity/conu/issues/155","id":301047322,"number":155,"title":"Implement OpenShift/Kubernetes as a backend","user":{"login":"TomasTomecek","id":1662493,"avatar_url":"https://avatars0.githubusercontent.com/u/1662493?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasTomecek","html_url":"https://github.com/TomasTomecek","followers_url":"https://api.github.com/users/TomasTomecek/followers","following_url":"https://api.github.com/users/TomasTomecek/following{/other_user}","gists_url":"https://api.github.com/users/TomasTomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasTomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasTomecek/subscriptions","organizations_url":"https://api.github.com/users/TomasTomecek/orgs","repos_url":"https://api.github.com/users/TomasTomecek/repos","events_url":"https://api.github.com/users/TomasTomecek/events{/privacy}","received_events_url":"https://api.github.com/users/TomasTomecek/received_events","type":"User","site_admin":false},"labels":[{"id":690093571,"url":"https://api.github.com/repos/fedora-modularity/conu/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-28T14:36:23Z","updated_at":"2018-03-08T13:44:34Z","closed_at":null,"author_association":"OWNER","body":"With current feature set, you can easily write some python code to validate your standalone containers (which run in dockerd). That's not enough. You usually run your containerized application in production orchestrated environment - Kubernetes or OpenShift. Therefore we should add support for these systems in conu.\r\n\r\nThe biggest problem with the implementation is the design itself - k8s orchestration doesn't utilize concept of containers nor images.\r\n\r\n## Detailed plan\r\n\r\n * Design\r\n   * As I wrote in the introduction, the design is the most critical part. We, as upstream maintainers, need to approve the proposed design.\r\n   * The initial design is expected to be simple: conu needs to be able to run a containerized application inside k8s. For that, we need only a few k8s primitives to be implemented:\r\n     * pod, service, deployment\r\n   * In case of OpenShift, the app needs to be runnable via `oc new-app`.\r\n   * We also require convenient user experience. Ideally users would provide well-known configuration object without the need of learning some complex python API, an example:\r\n     ```python\r\n     from conu import Pod\r\n     pod_spec = \"\"\"\r\n         apiVersion: v1\r\n         kind: Pod\r\n         metadata:\r\n           name: my-pod\r\n         spec:\r\n           containers:\r\n           - env:\r\n             - name: SOME_ENV_VAR\r\n               value: \"I am a value\"\r\n             image: library/fedora:27\r\n             imagePullPolicy: IfNotPresent\r\n             name: my-container\r\n           restartPolicy: Never\r\n     \"\"\"\r\n     pod = Pod(from_spec=pod_spec)\r\n     # run the pod now\r\n     ```\r\n * Implementation\r\n   * Once the design is approved, you can start working on the implementation.\r\n * It is expected to iterate on the design and implementation phases multiple times so we can achieve even the more complex scenarios.\r\n * Configuration\r\n   * Orchestration systems are very complex. When interacting with them, users usually require a flexible workflow which can be customized.\r\n   * Users should be able to specify: cluster, API token, the way to connect, namespace, user, clean after testing? And even more!\r\n * Template support\r\n   * Once we have the basics, it's time to support templates -- this is the usual way people deploy to k8s/OpenShift.\r\n * Parametrizing templates\r\n    * In order to be flexible and allow parametrizing test cases, we may need to be able to parametrize templates -- users can easily change parts of a template via some well-known templating system (such as jinja).\r\n * Finish line\r\n    * To prove that all the new code works, use it to write at least 2 simple test suites for container images delivered in Fedora and validate they work well in k8s/openshift.\r\n\r\n\r\nThis issue [is proposed](https://docs.fedoraproject.org/mentored-projects/gsoc/2018/ideas.html#complete-support-for-openshift-and-kubernetes-as-a-backend-in-conu) as a GSoC project as part of Fedora."},"comment":{"url":"https://api.github.com/repos/fedora-modularity/conu/issues/comments/371490232","html_url":"https://github.com/fedora-modularity/conu/issues/155#issuecomment-371490232","issue_url":"https://api.github.com/repos/fedora-modularity/conu/issues/155","id":371490232,"user":{"login":"TomasTomecek","id":1662493,"avatar_url":"https://avatars0.githubusercontent.com/u/1662493?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasTomecek","html_url":"https://github.com/TomasTomecek","followers_url":"https://api.github.com/users/TomasTomecek/followers","following_url":"https://api.github.com/users/TomasTomecek/following{/other_user}","gists_url":"https://api.github.com/users/TomasTomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasTomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasTomecek/subscriptions","organizations_url":"https://api.github.com/users/TomasTomecek/orgs","repos_url":"https://api.github.com/users/TomasTomecek/repos","events_url":"https://api.github.com/users/TomasTomecek/events{/privacy}","received_events_url":"https://api.github.com/users/TomasTomecek/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T13:44:34Z","updated_at":"2018-03-08T13:44:34Z","author_association":"OWNER","body":"Hi Matei, thanks for your interest!\r\n\r\nThe overall comment I have for you is that the design should be solved as part of the GSoC project.\r\n\r\n> My question is if we should also write wrappers/utils for different functions/actions you can do on pods(for > example)?\r\n\r\nI would say that yes. The main intent here is to provide this interface to people so they can use it to validate their containerized applications running in kube. I think that implementation for pods will have a smaller prio than implementation for Services and Deployments.\r\n\r\n> With the new concepts (pods, deployments ... etc ) you have new actions that you can perform, will the\r\n> conu project support this actions or just a subset and allow the user to use for example the k8s python\r\n> client for something else more specific?\r\n\r\nIdeally the implementation would use that API client and it would be fully available to users.\r\n\r\n> We can integrate jinja easily in the template but do we need to process it more? I would assume is enough \r\n> to render the template and then pass it to the k8s cluster to create the resource.\r\n\r\nYup.\r\n\r\n> Maybe some type checking and linting to see if it's a valid yaml but letting the k8s parser to see if the \r\n> string is valid.\r\n\r\nIf users want to shoot themselves to foot, they are free to do so. Type checking and linting is definitely a nice to have feature.\r\n\r\n> It looks to the that the design will make/break this type of backend, should the application contain the \r\n> \"final\" design or the actual design can be iterated as part of the GSoC program? I'm asking this because\r\n> coming up with a viable design (even in draft form) might take some time and I don't know if I can get one\r\n> done in time for the application process.\r\n\r\nI completely share your concern. The key here is not to overthink the design and instead start small, iterate and converge to a shared goal -- see last point in the list."}}
{"actor":{"display_login":"TomasTomecek"}}