{"id":20331154,"url":"https://github.com/comcast/kube-yarn","last_synced_at":"2025-12-01T01:03:13.663Z","repository":{"id":76618998,"uuid":"64241760","full_name":"Comcast/kube-yarn","owner":"Comcast","description":"Running YARN on Kubernetes with PetSet controller.","archived":false,"fork":false,"pushed_at":"2018-02-22T19:38:37.000Z","size":92,"stargazers_count":166,"open_issues_count":7,"forks_count":81,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-10-25T12:44:37.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-26T17:40:20.000Z","updated_at":"2025-03-08T19:46:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"b167bc7e-ff41-4392-afc2-2f673a8462cb","html_url":"https://github.com/Comcast/kube-yarn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Comcast/kube-yarn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fkube-yarn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fkube-yarn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fkube-yarn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fkube-yarn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/kube-yarn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fkube-yarn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27418899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-30T02:00:05.582Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T20:19:00.011Z","updated_at":"2025-12-01T01:03:13.645Z","avatar_url":"https://github.com/Comcast.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YARN on Kubernetes\n\n# Tags and Dockerfiles\n- `v1.0.0`, `latest` ([Dockerfile](https://github.com/Comcast/kube-yarn/blob/v1.0.0/Dockerfile)), [Hadoop 2.7.2](https://hub.docker.com/r/danisla/hadoop/), [Zeppelin 0.7.0](https://hub.docker.com/r/dylanmei/zeppelin/)\n\n# Docker image for kube-yarn\n\nImage for deploying the kube-yarn artifacts without any local dependencies.\n\n## Example usage:\n\nInvoke the default `make` target to deploy the full stack using the kubeconfig from your current home directory.\n\n```\ndocker run -it --rm -v ${HOME}/.kube/config:/root/.kube/config:ro danisla/kube-yarn:latest\n```\n\n\u003e Make sure to mount any additional volumes for files referenced within the kube config.\n\nTo remove the resources by invoking the `clean` target:\n\n```\ndocker run -it --rm -v ${HOME}/.kube/config:/root/.kube/config:ro danisla/kube-yarn:latest clean\n```\n\n## Architecture Diagram\n\n![Architecture](https://github.com/Comcast/kube-yarn/raw/master/docs/k8s_yarn_architecture.png)\n\n## StatefulSet Overview\n\nThe hadoop components are boostrapped using files from a `ConfigMap` to provide the init script and config xml files. This allows users to fully customize their distribution for their use cases.\n\nThe `ACP` env var can also be set to a comma-separated list of URLs to be downloaded and added to the classpath at runtime.\n\nLogs from the `${HADOOP_PREFIX}/logs` directory are tailed so that they can be viewed by attaching to the container.\n\n### `hdfs-nn` - HDFS Name Node\n\nThe namenode daemon runs in this pod container.\n\nCurrently, only 1 namenode is supported (no HA w/Zookeeper or secondary namenode).\n\n### `hdfs-dn` - HDFS Data Node\n\nThe datanode daemon runs in this pod container.\n\nThere can be 1 or more of these, scaled by changing the number of `replicas` in the spec.\n\n### `yarn-rm` - YARN Resource Manager\n\nThe resource manager daemon runs in this pod container.\n\nCurrently, only 1 resource manager is supported (no HA w/Zookeeper).\n\nThe WebUI can be accessed using the service port `8088` or at `localhost:8088` after running `make pf`.\n\n### `yarn-nm` - YARN Node Manager\n\nThe node manager daemon runs in this pod container.\n\nThere can be 1 or more of these, scaled by changing the number of `replicas` in the pod spec.\n\nThe amount of vcores and memory registered with the resource manager is reflected and infered from the pod spec resources using the [`Downward API`](http://kubernetes.io/docs/user-guide/downward-api/). These are made available to the container via the env vars `MY_CPU_LIMIT` and `MY_MEM_LIMIT` respectively and then added to the `yarn-site.xml` at runtime using the bootstrap script.\n\n### `zeppelin` - Zeppelin Notebook\n\nThe Zeppelin notebook is run in this pod container and can be used to run Spark jobs or hadoop jobs using the `%sh` shell interpreter.\n\nThe K8S yarn cluster config is mounted from the same `ConfigMap` over the top of the Zeppelin image dir to give it access to the cluster without modifying the base image.\n\nThe Zeppelin web app can be accessed using the service port `8080` or at `localhost:8081` after running `make pf`.\n\n## Running locally\n\nThis repo uses [`minikube`](https://github.com/kubernetes/minikube) to start a k8s cluster locally.\n\nThe [`Makefile`](./Makefile) contains targets for starting the cluster and helper targets for `kubectl` to apply the K8S manifests and interact with the pods.\n\nWhen running locally with minikube, make sure your VM has enough resources, you should set the number of cpus to 8 and memory to 8192. If not set, the pods won't have enough resources to fully start and will be stuck in the `Pending` creation phase.\n\nStarting minikube manually:\n\n```\nminikube start --cpus 8 --memory 8192\n```\n\nOr, start with the Makefile which will download minikube and start the cluster:\n\n```\nmake minikube\n```\n\n## Start the YARN cluster:\n\n```\nmake\n```\n\nThis will create all of the components for the cluster.\n\nRun this to create port forwards to `localhost`:\n\n```\nmake pf\n```\n\nYou should now be able to access the following:\n\n- YARN WebUI: `http://localhost:8088`\n- Zeppelin: `http://localhost:8081`\n\n### Full stack test\n\nTest hdfs, yarn and mapred using `TestDFSIO`, submitted from one of the node managers:\n\n```\nmake test\n```\n\nWhich runs this command on `yarn-nm-0`:\n\n```\n/usr/local/hadoop/bin/hadoop jar /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar TestDFSIO -write -nrFiles 5 -fileSize 128MB -resFile /tmp/TestDFSIOwrite.txt\n```\n\n### Spark on YARN in Zeppelin\n\nIn your browser, go to Zeppelin at: http://localhost:8081\n\nCreate a new note and run this in a paragraph:\n\n```\nsc.parallelize(1 to 1000).count\n```\n\nPress `shift-enter` to execute the paragraph\n\nThe first command executed creates the spark job on yarn and will take a few seconds, then you should get the result `1000` when complete.\n\n## Make targets:\n\n### `init`\n\nCreate the namespace, configmaps service account and hosts-disco service.\n\n### `create-apps`\n\nCreates hdfs, yarn and zeppelin apps.\n\n### `pf`\n\nCreates local port forwards for yarn and zeppelin.\n\n### `dfsreport`\n\nGets the state of HDFS.\n\n### `get-yarn-nodes`\n\nLists the registered yarn nodes by executing this in the node manager pod: `yarn node -list`\n\n### `shell-hdfs-nn-0`\n\nDrops into a shell on the namenode\n\n### `shell-yarn-rm-0`\n\nDrops into a shell on the resource manager.\n\n### `shell-zeppelin-0`\n\nDrops into a shell on the zeppelin container.\n\n## Shutting down\n\n```\nmake clean\n```\n\nShutdown the cluster\n\n```\nminikube stop\n```\n\nOr:\n\n```\nmake stop-minikube\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fkube-yarn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fkube-yarn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fkube-yarn/lists"}